Skip to content

Instantly share code, notes, and snippets.

@kauemurakami
Last active July 7, 2020 05:12
Show Gist options
  • Save kauemurakami/0b2e62e0cedb0bfdbcbe0836f84cbc11 to your computer and use it in GitHub Desktop.
Save kauemurakami/0b2e62e0cedb0bfdbcbe0836f84cbc11 to your computer and use it in GitHub Desktop.
controller counter example
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