Created
July 13, 2019 21:37
-
-
Save junjizhi/e1cc6afbd0fdbc9f7a43609920c96295 to your computer and use it in GitHub Desktop.
Flutter BLoC and Provider: A Shopping Cart Example - Hooking up Bloc with the app
This file contains hidden or 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
// https://github.com/junjizhi/flutter-shopping-cart | |
import 'cart_bloc.dart'; | |
import 'package:provider/provider.dart'; | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return ChangeNotifierProvider<CartBloc>( | |
builder: (context) => CartBloc(), | |
child: MaterialApp( | |
title: 'Flutter Shopping Cart Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: MyHomePage(title: 'Gift Shop'), | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment