Created
October 29, 2021 15:58
-
-
Save lesnitsky/e5d272408860104d6f3522618ef50535 to your computer and use it in GitHub Desktop.
AppModel + redux example
This file contains 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
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