I just new in flutter and coming from android, In android we declare sharedPreference name like
SharedPreferences sp = Activity.this.getSharedPreferences("USER", MODE_PRIVATE);
by this in android USER.xml file was created,
So, what will be the name of sharedPreference in created by flutter app in this example? how i store collection of data in sharedPreference,like USER, HOBBIES TYPES, etc
addIntToSF() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setInt('intValue', 123);
}
read data
getIntValuesSF() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
//Return int
int intValue = prefs.getInt('intValue');
return intValue;
}