Questions tagged [flutter-bloc]

For questions relating to the "flutter_bloc" package for the Flutter framework. Use this tag in combination with the general [flutter] tag. If your question applies to Flutter more generally, use the [flutter] tag only.

This tag should be used for any questions regarding the flutter_bloc package for the Flutter framework.

flutter_bloc is a package implementing the BloC pattern for Flutter, specifically the BlocProvider and BlocBuilder classes.

To get started, you can read through the README document on GitHub.

932 questions
0
votes
1 answer

How to sync two CircularProgressIndicators at the same time?

I'm almost finished with my 2FA app. It generates TOTP codes for a given secret key, digits, interval and algorithm. However, I have a hard time with syncing multiple CircularProgressIndicators to repeat at the same time. Have a look at my video. It…
szakes1
  • 794
  • 3
  • 16
  • 35
0
votes
1 answer

Cannot call Flutter Singleton from another package

I am trying to import an asynchronous function in Flutter to handle securely storing user data. The problem is I keep getting the following error: packages/authentication_repository/lib/src/authentication_repository.dart:64:15: Error: Method not…
cp-stack
  • 785
  • 3
  • 17
  • 40
0
votes
1 answer

Why BlocBuilder is stuck in the initial state while using get_it?

I'm using flutter_bloc to manage the states of my app, and get_it to inject the needed dependencies following the idea suggested by the Reso Coder's Flutter Clean Architecture Proposal. Everything is working fine except that the bloc is not changing…
Yunet Luis Ruíz
  • 425
  • 4
  • 16
0
votes
2 answers

Flutter: bloc not removing data from the list

I'm trying to create list of favourite news using bloc, now if I want to add to the favourite list it does happen but if I want to remove it then list is not getting updated so it is not removing from UI. My bloc logic, class FavouriteBloc extends…
Pokaboom
  • 1,110
  • 9
  • 28
0
votes
1 answer

Unimplemented handling of missing static target

I have a login button on the start screen. I want when the user clicks this login button, I will go to the login screen using "MaterialPageRoute" and I want to pass "BlocProvider" for Login screen. I did the following and an error occurred. "Error…
0
votes
1 answer

How to use Flutter BLoC pattern on specific scenarios?

Recently I am start to learn Flutter and its BLoC partten, and there are many class in BLoC library, like Bloc, PublishSubject, StreamController, BehaviorSubject and etc.. My question is, what the scenarios that I can use these classes? For example,…
Kevin Zhang
  • 1,012
  • 6
  • 14
0
votes
0 answers

How to access BLoC inside SearchDelegate of showSearch in Flutter

I want to have separated logics for accesing data and using SearchDelegate. But I couldn't provide data from BLoC to SearchDelegate in a clean way. The problem is, I want to load data only when search icon in appBar is clicked. Not everytime…
emrerdem1
  • 1
  • 1
0
votes
1 answer

Flutter http.post method doesn't work for me. Every time I try to run it, it brings up ticker.dart

Future authenticate(LoginRequest request) async { var url = _baseUrl + loginUrl; Map headers = {'Content-Type': 'application/json;'}; final res = await http.post(url, headers: headers, body: request.toJson()); …
0
votes
2 answers

The argument type 'BlocBuilder' can't be assigned to the parameter type 'SliverChildDelegate'

I need to load data from BlocBuilder to a SliverGrid to show a grid of items. When I use BlocBuilder as SliverGrid's delegate, I get this error: The argument type 'BlocBuilder' can't be assigned to the parameter type…
Hossein Yousefpour
  • 3,827
  • 3
  • 23
  • 35
0
votes
1 answer

BlocListener does not build widget on state change

I'm trying to display a text based on the state of a bloc so I decided to use BlocListener as I think that's the main purpose of of the widget. I want to display a text when the state is AuthFailed. BlocListener BlocListener( …
stalwart1014
  • 451
  • 1
  • 9
  • 29
0
votes
1 answer

Flutter Bloc State won't be yielded after change from the Page pushed on top

The AddWorkoutEvent is dispatched correctly from the PageCreateWorkout with a DbMWorkout. This will be inserted in the correct table of the DB. The PageCreateWorkout will be notified with the WorkoutAddedState to go to PageWorkoutDetail with the…
DJ2695
  • 62
  • 2
  • 6
0
votes
0 answers

Root Widget MaterialApp called multiple times

As of my understanding, I know that the stateful widget build method can be called multiple times. I don't understand why the Root widget MaterialApp is called multiple times even I have used a stateless widget. Here is the code Future main()…
Jigar Fumakiya
  • 2,039
  • 1
  • 8
  • 21
0
votes
1 answer

Why AutoCompleteTextField is not showing any suggestion in Flutter?

I am new to Flutter and currently working on a project where I need to show user a list of matched members so that a user can easily select one of them. For that I use AutoCompleteTextField. It is working fine as long as provided by already fetched…
Azhar Bhatti
  • 91
  • 1
  • 3
  • 14
0
votes
0 answers

Flutter bloc - Event only gets called 2 times inside the bloc logic

I'm having problems to send the event in the bloc. The problem I'm having is that when I send the first event the Bloc is getting called and after I recall it again with a diferrent tab and it works, but when I change to another tab the bloc doesn't…
0
votes
1 answer

Previous screen Bloc call after open new screen in Flutter

I am using Bloc pattern in my project, But my previous screen's Bloc still call in my new screen. I have dispose my Bloc but in screen dispose method is not call. Please help to solve this problem. Bloc file: class ForgotPasswordBloc extends Object…
khushbu movaliya
  • 127
  • 1
  • 1
  • 12