Issue When trying to intercept the backbutton press, I want to reset the state of the main Bloc to the initial state, so I want to add a kind of reset event when pressing back. I can’t wrap my head
Continue readingTag: flutter-bloc
Concepts of BlocListener, BlocBuilder, and BlocProvider
Issue I am having difficulty understanding this structure. My idea is simple: I have a MultiBlocProvider in my build with two BlocProviders. The first one uses AuthBloc and immediately calls my GetToken, and the second one prepares my provider (TokenBloc).
Continue readingCan we access Bloc without Passing Buildcontext param
Issue I am migrating to GetX to Bloc, in GetController we don’t need BuildContext to call controller, so is there any way to Provide the Context to the bloc class from BlocProvider and we get bloc without providing buildContext like
Continue readingList of checkbox not updating correctly on the UI (Flutter BloC)
Issue I’m using the BloC pattern for the first time in my App. And I am having multiple of problems with it. For my Question i have a list of boolean ( Checkboxes ) The problem is when I click
Continue readingFlutter BlocConsumer react only to certain state property changes
Issue Is it possible in Bloc, inside a BlocConsumer to only redraw a Widget when certain subset of properties of the Bloc’s state change I want the "buildWhen" in one screen to return true only if 3 props changed and
Continue readingHow to manage an enum-typed BLoC event?
Issue I am using these packages for the following codes: flutter_bloc, oxidized, freezed, and get_it tmdb_bloc.dart typedef TmdbState = PageState<List<MovieEntity>>; class TmdbBloc extends Bloc<TmdbEvent, TmdbState> { final TmdbPublicUseCases useCases; TmdbBloc(this.useCases) : super(const PageState.initial()) { on<TmdbEvent>((event, emit) async { event.map( getPopularMovies:
Continue readingHow can I provide a bloc for only two pages of application?
Issue in my application there are a couple of pages. two pages need to use one bloc. I use namedRoutes for navigating between pages and the BlocProvider is on the top of app widget so it is provided for all
Continue readingWhat is the best way to using BLoC, one BLoC per screen or one BLoC per part of screen?
Issue I’m currently developing the Flutter application using BLoC with flutter_bloc and I wonder what is the best way to manage the state using BLoC. In my situation, there’re two main separate parts on the same screen. So, I end
Continue readingA value of type 'Null' can't be returned from the method 'onGenerateRoute' because it has a return type of 'Route<dynamic>'
Issue Actually I was trying to add genearatedRoute but i was facing this error A value of type ‘Null’ can’t be returned from the method ‘onGenerateRoute’ because it has a return type of ‘Route’ Below is my code class AppRouter
Continue readinghow to transfer this code in flutter_bloc V7 to flutter_bloc V8?
Issue the problem is that I want to transfer this code from bloc 7 to bloc 8 using emit and on<RunLongRunningStreamedEvent and i know that mapEventtoState no longer exisits import ‘package:bloc/bloc.dart’; import ‘data/repository/irepository.dart’; import ‘home_event.dart’; import ‘home_state.dart’; class HomeBloc extends
Continue reading