Created
March 26, 2022 05:00
-
-
Save bharatmk256/0e799ae9b581218acf884c15fda439d7 to your computer and use it in GitHub Desktop.
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_redux/flutter_redux.dart'; | |
import 'package:redux/redux.dart'; | |
import 'logic/reducers.dart'; | |
import 'screen/my_home_screen.dart'; | |
void main() { | |
final store = Store<int>(counterReducer, initialState: 0); | |
runApp( | |
MyApp( | |
store: store, | |
), | |
); | |
} | |
class MyApp extends StatelessWidget { | |
final Store<int> store; | |
const MyApp({ | |
Key? key, | |
required this.store, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return StoreProvider<int>( | |
store: store, | |
child: MaterialApp( | |
theme: ThemeData.dark(), | |
title: "How to Use Redux", | |
home: const MyHomeScreen(), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment