Created the home bloc provider

This commit is contained in:
Mariano Uvalle 2019-03-13 20:59:49 -06:00
parent 4d6fb3d04e
commit b9f0831c27
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
import './home_bloc.dart';
export './home_bloc.dart';
class HomeProvider extends InheritedWidget {
final HomeBloc bloc;
HomeProvider({
Key key,
Widget child,
}) : bloc = HomeBloc(),
super(key: key, child: child);
bool updateShouldNotify(InheritedWidget oldWidget) => true;
static HomeBloc of(BuildContext context) {
return (context.inheritFromWidgetOfExactType(HomeProvider) as HomeProvider)
.bloc;
}
}