hi guys i m new in flutter and my question is what is the right way to provide a bloc? i decided to provide theme in main file in named rout section but the problem is when i need a bloc inside of other bloc i cant provide it. here is my main file routes section the problem is for example i wanna provide a AssetDevicesPageBloc bloc to assetPage bloc how can i do such a thing cuz i dont have access. am i dong providing blocs in wrong way ? for first time i wanted to provided all blocs in one place then use blockprovider.value for each widget but when i searched about it,i found that its wrong way of using resources.please help.thank you
return MaterialApp(
routes: {
'loginPage': (context) => BlocProvider(
child: LogInPage(),
create: (BuildContext context) {
return LoginBloc(
userRepository: userRepository,
authenticationBloc:
BlocProvider.of<AuthenticationBloc>(context));
},
),
'AssetDevicePage': (context) => MultiBlocProvider(
child: AssetDevicesPage(),
providers: [
BlocProvider(
create: (BuildContext context) => AssetDevicesPageBloc(
userRepository: userRepository,
dataBaseRepository: dataBaseRepository,
deviceRepository: deviceRepository)),
BlocProvider(
create: (BuildContext context) => DeviceViewSwitcherBloc(
dataBaseRepository, userRepository, deviceRepository)),
BlocProvider(
create: (BuildContext context) =>
LampBloc(deviceRepository, dataBaseRepository)),
],
),
'AssetPage': (context) => MultiBlocProvider(
providers: [
BlocProvider(
create: (BuildContext context) =>
CategoryBloc(userRepository, dataBaseRepository),
),
BlocProvider(
create: (BuildContext context) =>
AssetPageBloc(BlocProvider.of<CategoryBloc>(context)),
),
],
child: AssetPage(),
),
},