I'm trying to use Shared Preferences but I have this strange behavior.
Im using:
shared_preferences: ^0.5.6+2
On a StateFull Widget on the initState I have this:
@override
void initState() {
super.initState();
_testing()
}
Future<void> _testing() async{
print("starting")
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setInt('value', 1);
print("saved?")
}
When I run the code with flutter run, I only get the print for "starting", not for "saved?".
The same exact code Im using for this project I've used to build an Android App and it worked just fine. But for iOS is not working.
What I am missing?