skip to Main Content

Flutter – Bloc emit state issue

import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:moms/features/chat/domain/entities/message_entity.dart'; import 'package:moms/features/chat/domain/usecases/send_message.dart'; import 'package:moms/features/chat/domain/usecases/get_messages.dart'; import 'package:moms/features/chat/domain/usecases/get_or_create_thread_usecase.dart'; part 'chat_event.dart'; part 'chat_state.dart'; class ChatBloc extends Bloc<ChatEvent, ChatState> { final GetOrCreateThread getOrCreateThread; final GetMessages getMessages; final SendMessage sendMessage; ChatBloc({ required this.getOrCreateThread, required this.getMessages, required this.sendMessage, }) : super(ChatInitial()) {…

VIEW QUESTION

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
Back To Top
Search