Skip to content

Instantly share code, notes, and snippets.

@ThinkDigitalSoftware
Last active December 29, 2022 22:41
Show Gist options
  • Save ThinkDigitalSoftware/d66524458ea9587a7c33c6cf7d71ea66 to your computer and use it in GitHub Desktop.
Save ThinkDigitalSoftware/d66524458ea9587a7c33c6cf7d71ea66 to your computer and use it in GitHub Desktop.
Flutter Increment Counter Example
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
...
}
@OriginalBallO
Copy link

merci pour l'exemple c'est bien fait
je peux avoir pour decreinmentatio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment