Skip to content

Instantly share code, notes, and snippets.

@Zfinix
Created October 7, 2019 15:44
Show Gist options
  • Select an option

  • Save Zfinix/23b6f48ba8a1bf586b470a15ee52618f to your computer and use it in GitHub Desktop.

Select an option

Save Zfinix/23b6f48ba8a1bf586b470a15ee52618f to your computer and use it in GitHub Desktop.
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