Skip to content

Instantly share code, notes, and snippets.

@lukaskris
Created July 3, 2019 11:07
Show Gist options
  • Save lukaskris/71be0055e4824ff279ed600cb3c3ba97 to your computer and use it in GitHub Desktop.
Save lukaskris/71be0055e4824ff279ed600cb3c3ba97 to your computer and use it in GitHub Desktop.
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