Skip to content

Instantly share code, notes, and snippets.

@lesnitsky
Created October 29, 2021 15:58
Show Gist options
  • Save lesnitsky/e5d272408860104d6f3522618ef50535 to your computer and use it in GitHub Desktop.
Save lesnitsky/e5d272408860104d6f3522618ef50535 to your computer and use it in GitHub Desktop.
AppModel + redux example
final store = Store<int>(counterReducer, initialState: 0);
void main() {
runApp();
}
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Builder(builder: (context) {
StoreProvider.bind(context); // calls AppModel.init
return Home();
}),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment