I have this app where my widget is wrapped with MultiBlocProvider where I send down 2 providers:
MultiBlocProvider(
providers: [
BlocProvider<AppCubit>(
create: (BuildContext context) => AppCubit(),
),
BlocProvider<ProfileCubit>(
create: (BuildContext context) => ProfileCubit(),
),
],
child: HomePage(),
On the HomePage widget I access the first one using a BlocConsumer but I don't know how to grab all of them. Do I need to keep nesting BlocConsumer into the builder section in order to access my providers? What is the recommended way of accessing the x number of providers I send down to my widgets?
class HomePage extends StatefulWidget {
@override
Widget build(BuildContext context) {
return BlocConsumer<AppCubit, AppState>(
...
builder: (context, state) {
return Scaffold(
backgroundColor: Theme.of(context).primaryColorLight,
body: null,
);
},
...
);
}
}