skip to Main Content

Can't get the right return type in Flutter BlocConsumer

I'm having trouble accessing the state in bloc consumer This is repository implementation class for managing errors class UserRepositoryImplementation implements UserRepository { const UserRepositoryImplementation(this._remoteDataSource); final UserRemoteDatasource _remoteDataSource; @override ResultFuture<List<UserListModel>> fetchAllUsers() async { try { final result = await _remoteDataSource.fetchAllUsers(); return…

VIEW QUESTION

Flutter – listener not trigger when using local bloc (bloc: parameter)

I have a bloc which has global state (BlocProvider is initialised before Material App). In the onPreesed callback of a button I have a bloc listener: BlocListener<RiskAssesmentValueCubit, RiskAssesmentValueState>( bloc: riskAss ..checkActualVersusCalculated(user.customerId, riskAttitudeQuestionsDetails), listener: (BuildContext context, RiskAssesmentValueState state) { print('Listener called');…

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