Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.69 KB | None | 0 0
  1. //main class
  2.  Widget build(BuildContext context) {
  3.     return MultiBlocProvider(
  4.  
  5.       providers: [
  6.         .....
  7.         BlocProvider<AuthenticationBloc>(
  8.             create: (BuildContext context){
  9.               return AuthenticationBloc(userRepository: userRepository);
  10.  
  11.             }
  12.         ),
  13.         BlocProvider<CartBloc>(
  14.           create: (BuildContext context){
  15.             return CartBloc(
  16.               cartRepository: cartRepository,
  17.               userBloc: BlocProvider.of<UserBloc>(context)
  18.             );
  19.           },
  20.  
  21.         )
  22.    ],
  23.        child: MaterialApp(
  24.           routes: {
  25.             "/pricelist" : (context) => PricelistPage(),
  26.           }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement