Created
October 7, 2019 15:44
-
-
Save Zfinix/23b6f48ba8a1bf586b470a15ee52618f to your computer and use it in GitHub Desktop.
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 HomeController extends ChangeNotifier { | |
| int _counter = 0; | |
| int get counter => _counter; | |
| set counter(val) { | |
| _counter = val; | |
| notifyListeners(); | |
| } | |
| increment(){ | |
| _counter++; | |
| notifyListeners(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment