skip to Main Content

Flutter – Bloc not triggering [builder] when emit the same state with different attributes, using equatable and props

// reports_bloc.dart part 'reports_event.dart'; part 'reports_state.dart'; class ReportsBloc extends Bloc<ReportsEvent, ReportsState> { final ReportsRepository _reportsRepository; ReportsBloc(this._reportsRepository) : super(ReportsInitial()) { on<ReportsListRequested>(_OnReportsListRequested); on<ReportSubmitted>(_OnReportAddRequested); on<ReportMessageArrived>(_OnReportMessageArrived); on<ReportMessageSubmitted>(_OnReportMessageSubmitted); } void _OnReportMessageSubmitted( ReportMessageSubmitted event, Emitter<ReportsState> emit, ) async { // the state in this point is…

VIEW QUESTION

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

Flutter bloc – How can I use BlocBuilder?

I'm a Flutter Beginer and about to use Bloc. but this error message comes up and I tried to use 'extends StateStreamable<CalculatorEvent>' or 'implements' but it doesn't work. please help me to solve this error. Thank you. 'CalculatorBloc' doesn't conform…

VIEW QUESTION
Back To Top
Search