Created
November 19, 2019 07:25
-
-
Save JOSHIMOH/760b7842a26a12930d8b7e76edffe4e9 to your computer and use it in GitHub Desktop.
Observable
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 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