Skip to content

Instantly share code, notes, and snippets.

@bharatmk256
Created March 26, 2022 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bharatmk256/0e799ae9b581218acf884c15fda439d7 to your computer and use it in GitHub Desktop.
Save bharatmk256/0e799ae9b581218acf884c15fda439d7 to your computer and use it in GitHub Desktop.
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