skip to Main Content

Flutter BloC couldn't find correct provider when context.read is called

I created a basic project to learn Flutter better. In bnb.dart file if I use: context.read<AppBottomNavigationBarState>().selectedIndex to change the currentIndex field of the BottomNavigationBar. The application throws: The following ProviderNotFoundException was thrown building BlocBuilder<AppBottomNavigationBarCubit, AppBottomNavigationBarState> But if I change that…

VIEW QUESTION

Bad condition – Cubit – Flutter

I'm trying to get to the RegistrationSendCode screen. But unfortunately I am getting a bad status error. Here is my provider and builder - Provider - class RegistrationSendCode extends StatelessWidget{ @override Widget build(BuildContext context){ return BlocProvider<RegistrationSendCodeCubit>( create: (context) => RegistrationSendCodeCubit(),…

VIEW QUESTION

Flutter Bloc Listen to stream and emit state with Cubit

How can I listen to stream and emit state with Cubit? With Bloc we can do something like this: on<VideoStreamPlayPauseEvent>( (event, emit) async { if (event.play) { await emit.forEach( videoStreamingRepo.videoDataStream, onData: (VideoData videoStreamData) => VideoStreamState( currentFrame: videoStreamData, isPlaying: true, ),…

VIEW QUESTION
Back To Top
Search