-
-
Save simonpham/4aaab5a8ddfcae06fdb0057aeb6230b8 to your computer and use it in GitHub Desktop.
how to assign a value to sharedPrefs.username ?
@ripesol just call sharedPrefs.username = "someName";
Thank you so much! , It's so easy to use shared preferences with your code.....They should have added your code below their official documentation.....It's so easy to use...
Thank you seariously!!!
Awesome! So easy!
Hi, I am new to Flutter and Dart, so maybe I am just ignoring something very trivial.
I am using your exact code, but when I run the app, I receive this error referring to row 6:
Error: Field '_sharedPrefs' should be initialized because its type 'SharedPreferences' doesn't allow
null.
Hi, I am new to Flutter and Dart, so maybe I am just ignoring something very trivial.
I am using your exact code, but when I run the app, I receive this error referring to row 6:
Error: Field '_sharedPrefs' should be initialized because its type 'SharedPreferences' doesn't allow null.
I have updated the code to be compatible with null-safety. Thank you for reporting!
I have updated the code to be compatible with null-safety. Thank you for reporting!
So where is the update?
So where is the update?
@elinonga it's updated here.
Awesome. Thx !
Hi folks 👋
I have release a new package easy_hive, which is a better and simpler approach for storing key-value data instead of using shared_preferences. Please have a look.
Thank you so much!
🦊
Hi! I'm using this code but I get this error:
Undefined name '_internal'. Try correcting the name to one that is defined, or defining the name.
Thank you for your post in medium!
Hi! I'm using this code but I get this error: Undefined name '_internal'. Try correcting the name to one that is defined, or defining the name.
Make sure you didn't miss this line:
SharedPrefs._internal();
Anyway, please check my above comment.
I'm sry I meant '_instance'. Anyway I'm checking your awesome package
I'm sry I meant '_instance'. Anyway I'm checking your awesome package
I have updated the code. Apologize for my mistake.
static final SharedPrefs _instance = SharedPrefs._internal();
how many years experience in flutter?
how to assign a value to sharedPrefs.username ?