skip to Main Content

Flutter – Missing Statechange in BlocListener (Cubit, initial Load)

I'm refactoring some of my blocs down to cubits and I'm struggling with an unexpected behavior. Widget @override Widget build(BuildContext context) { return BlocProvider( create: (context) => injector.get<DocumentListCubit>()..load(), child: BlocConsumer<DocumentListCubit, DocumentListState2>( listener: (context, state) { context.read<GlobalBusyIndicatorCubit>().busy = state.phase == DocumentListState2Enum.loading;…

VIEW QUESTION

Multi Bloc Provider Flutter

I have several cubits working in my application, but for the cubit to work it always needs to be injected into the MyApp Main of my application, is there any way to concentrate the Cubit / Bloc instances without having…

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

how can i get length of list in widget – Flutter

I can't get the length of the list in the widget although I wrote everything correct this is my cubit class AppCubit extends Cubit<NewsStates> { AppCubit() : super(NewsInit()); static AppCubit get(context) => BlocProvider.of(context); MianTeams? mianTeams; void getTimes() { emit(NewsLoding()); DioHelper.getData(…

VIEW QUESTION
Back To Top
Search