Home > Blockchain >  Is it possible to access android shared preference to a flutter app?
Is it possible to access android shared preference to a flutter app?

Time:10-04

I am updating my current android app to flutter. Is it possible to access the sharedPreferences used in android app using the shared_preferences plugin on flutter.

So, when the user updates the app, they are logged in directly.

CodePudding user response:

You should take a look at the Android implementation. The library uses shared preferences with the name FlutterSharedPreferences.

Moreover, list, big int and double types have their respective keys prefixed, as seen in the above implementation.

CodePudding user response:

You can use this package native_shared_preferences, there are some method which can help you like (containsKey(), getKeys()).

this package native_shared_preferences storing without adding prefix to the keys. Unlike this package shared_preferences, where it always add a prefix to each variable stored using it

prefix: "flutter_"

  • Related