```
_incrementCounter() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
setState(() {
countString = countString + " 1";
});
int counter = (prefs.getInt('counter') ?? 0) + 1;
await prefs.setInt('counter', counter);
}
_getCounter() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
setState(() {
localCount = prefs.getInt('counter').toString();
});
}
```