Last active
December 29, 2022 22:41
-
-
Save ThinkDigitalSoftware/d66524458ea9587a7c33c6cf7d71ea66 to your computer and use it in GitHub Desktop.
Flutter Increment Counter Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++; | |
}); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
merci pour l'exemple c'est bien fait
je peux avoir pour decreinmentatio