-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
bugSomething isn't workingSomething isn't working
Description
i run main.dart, always "Button tapped 1 time", when i restart App, it become "0 times".I just added some printing:
Future _incrementCounter() async {
final Map<String, Object> values = await prefs.getAll();
final int counter = (values['counter'] as int? ?? 0) + 1;
print('_incrementCounter:values:$values');
setState(() {
_counter = prefs.setValue('Int', 'counter', counter).then((bool success) {
print('_incrementCounter:success:$success');
return counter;
});
});
}
No matter how many times i click,output always:
_incrementCounter:values:{}
_incrementCounter:success:true
...
No error message is reported。
so,where might the problem occur?
Looking forward to your reply,
thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working