Skip to content

Instantly share code, notes, and snippets.

@JOSHIMOH
Created November 19, 2019 07:25
Show Gist options
  • Select an option

  • Save JOSHIMOH/760b7842a26a12930d8b7e76edffe4e9 to your computer and use it in GitHub Desktop.

Select an option

Save JOSHIMOH/760b7842a26a12930d8b7e76edffe4e9 to your computer and use it in GitHub Desktop.
Observable
class Counter {
Counter() {
increment = Action(_increment);
}
final _value = Observable(0);
int get value => _value.value;
set value(int newValue) => _value.value = newValue;
Action increment;
void _increment() {
_value.value++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment