Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define MODE of Shared_Preferences in Flutter

In Android, we are defining Shared Preferences Mode like

getSharedPreferences(String name, int mode)

MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE

How we can define MODE in shared_preferences flutter?

like image 986
Md Shahnawaz Avatar asked Nov 19 '25 00:11

Md Shahnawaz


1 Answers

SharedPreferences uses MODE_PRIVATE and by now we don't have the option to change this.

The other options are now deprecated and it is not recommended to use then. See https://developer.android.com/reference/android/content/Context.html#MODE_WORLD_READABLE.

like image 179
Md Shahnawaz Avatar answered Nov 21 '25 14:11

Md Shahnawaz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!