Created
July 3, 2019 11:07
-
-
Save lukaskris/71be0055e4824ff279ed600cb3c3ba97 to your computer and use it in GitHub Desktop.
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 CounterApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return new ScopedModel<CounterModel>( | |
| model: new CounterModel(), | |
| child: new Column(children: [ | |
| new ScopedModelDescendant<CounterModel>( | |
| builder: (context, child, model) => new Text('${model.counter}'), | |
| ), | |
| new Text("Another widget that doesn't depend on the CounterModel") | |
| ]) | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment