Last active
July 7, 2020 05:12
-
-
Save kauemurakami/0b2e62e0cedb0bfdbcbe0836f84cbc11 to your computer and use it in GitHub Desktop.
controller 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 MyController extends GetxController { | |
final _num = 0.obs; | |
get num => this._num.value; | |
set num(value) => this._num.value = value; | |
increment() { | |
this.num++; | |
} | |
decrement() { | |
this.num--; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment