Last active
February 14, 2020 07:19
-
-
Save f3ath/75910d0c3e52c41f53a68cfa8c0eadd7 to your computer and use it in GitHub Desktop.
MVC
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
abstract class State {} | |
abstract class Model { | |
Stream<State> get state; | |
void doThis(); | |
void doThat(); | |
} | |
class Controller { | |
final Model m; | |
Controller(this.m) { | |
m.state.listen(_redrawUI); | |
} | |
void buttonClick() => m.doThat(); | |
void sliderMove() => m.doThis(); | |
void _redrawUI(State event) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment