Skip to content

Instantly share code, notes, and snippets.

@junjizhi junjizhi/main.dart

Created Jul 13, 2019
What would you like to do?
Flutter BLoC and Provider: A Shopping Cart Example - Hooking up Bloc with the app
import 'cart_bloc.dart';
import 'package:provider/provider.dart';
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return ChangeNotifierProvider<CartBloc>(
builder: (context) => CartBloc(),
child: MaterialApp(
title: 'Flutter Shopping Cart Demo',
theme: ThemeData(
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.