Home > Mobile >  Disadvantage of using Shared Preferences in Flutter
Disadvantage of using Shared Preferences in Flutter

Time:05-03

I am new to Flutter. Is it okay to store data like users credentials (username and password) using Shared Preferences package? What is the disadvantage of using Shared Preferences to hold and pass data between multiple screens in Flutter?

CodePudding user response:

You better store data that shows whether the user is authenticated or user login id.

SharedPreferences is mostly used to store small amount (2048 bytes) of data.

I don't think it's an efficient way to store data in shared preference just for accessing from different pages. Consider using a common class or state management tools like provider

CodePudding user response:

Not answering in the way like "disadvantage of using shared preference". Shared preferences is stored in the data folder which could be read by the user only if the user is using the rooted device which gives access to that directory.

CodePudding user response:

For storing secure data you can use the flutter_secure_storage package.

go through this article once.

  • Related