Skip to content

Instantly share code, notes, and snippets.

@junjizhi junjizhi/main.dart
Created Jul 13, 2019

Embed
What would you like to do?
Flutter BLoC and Provider: A Shopping Cart Example - Hooking up Bloc with the app
// 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
You can’t perform that action at this time.