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
0 answers

ListView.Builder creating duplicate items on scroll down in Flutter

I'm fetching the api data by using http package and flutter-bloc package. I successfully implemented the pagination means when i scroll down at bottom fetch the api by incrementing the page no 1. Now the problem is when i scroll down it returns…
Mohammed Nabil
  • 662
  • 1
  • 8
  • 36
0
votes
1 answer

How to refresh page(get data api event trigger again) when event delete triggered with flutter_bloc?

I'm getting data from the api and show them as list then choose particular index to delete data from the list and from the database too. actually that particular Item is being deleted from the database but need to trigger get data api again then…
Shruti Ramnandan Sharma
  • 4,027
  • 13
  • 44
  • 76
0
votes
1 answer

Should I start Cubit then later on refactor the code to Bloc?

For the past week I have been learning the Bloc pattern. From that, I understand that I have 2 choices to use Cubit and Bloc. Cubit is for simple state, and Bloc is for complex state (that's my understanding between the two). Should I implement…
Jai
  • 15
  • 4
0
votes
1 answer

creating initial state of radio group using bloc and freezed libraries

I am using bloc with freezed libraries. i need when the user open the app the first radio button is chosen. i have been created an observer bloc which tolled me that the initial state and the initial event have been invoked, but when i print …
0
votes
1 answer

Flutter BlocBuilder builder gets called only initially and doesn't react to state change

I've just started with Flutter recently. BLoC does indeed has a steep learning curve... As it is clear from the title, the BlocBuilder logic gets correctly executed only once, when the app is started. Afterwards, however, UI doesn't get rebuilt on…
Oleksandr K
  • 119
  • 1
  • 10
0
votes
2 answers

using bottom navigator sheet with bloc showing only once

I am crated a float action button, on click a bottom sheet will popup. i am using a bloc with freezed library. when i tape to the float action bottom once the application hot restart the bottom sheet app appeared, when i click again on the float…
0
votes
1 answer

How to set PlayerState with flutter_bloc, audioplayers package Flutter

I am using this package: https://pub.dev/packages/audioplayers I have 2 problems, first of all the way the code is, when I press play the music starts, but when I press stop it does nothing, it is as if I were emitting a state that does not hit the…
Dubbain
  • 73
  • 1
  • 8
0
votes
1 answer

Flutter Navigator popUntil with Bloc not rebuilding state

I have a 3 step form, For each step I am pushing a new page by passing the Bloc provider wrapped in MaterialPageRoute using Navigator so the same bloc can be accessed on those pages like…
Manas
  • 3,060
  • 4
  • 27
  • 55
0
votes
1 answer

Implement Guest Feature/ User in E-commerce App Using Flutter Bloc

I am trying to build an app similar like of e-commerce app (Amazon) in that app when the user open the app it will not go the login screen instead it will go to home screen. Login screen will only comes if the user is not login in checkout screen by…
Mohammed Nabil
  • 662
  • 1
  • 8
  • 36
0
votes
1 answer

Unhandled Exception: BlocProvider.of() called with a context that does not contain a SignupBloc

I am a beginner in flutter_bloc library pattern, i am trying to signup http post request. I follow all the bloc necessary steps but when i click on Signup button it shows me on the log "Unhandled Exception:BlocProvider.of() called with a context…
Mohammed Nabil
  • 662
  • 1
  • 8
  • 36
0
votes
1 answer

RangeError (index): Invalid value: Valid value range is empty: 0 Nested Json in Flutter

I am trying to fetch the api by using flutter_bloc library pattern and i successfully able to get the data but problem is at below i have mention the json data the first two elements has an empty [] array in restaurant_branch and last (third)…
Mohammed Nabil
  • 662
  • 1
  • 8
  • 36
0
votes
1 answer

Questions on structuring a flutter(-bloc) app

Say I have an App that uses Blocs/Cubits and I have a few repositories, like a AuthRepository and a FriendsRepository. Now the problem is the following: I want the repositories to be in different packages than the actual app, like such: |-app …
0
votes
0 answers

In bloc test the add event doesnot work when decodeImageFromList is used inside bloc

Bloc test fails to call an event if we use decodeImageFromList We had to get the width and height of an image file inside bloc for that we are using decodeImageFromList but after that when we add another event, that event doesn't execute while…
xkxeeshankhan
  • 351
  • 4
  • 8
0
votes
1 answer

Flutter bloc doesn't trigger the loading screen the second time when I click the submit button the second time after I close it if no state change

the loading screen is popped when response are fetched, but when no data are fetched the loading screen page continues to show. when I close it and click the submit button the second time, the loading screen does not show. I am using flutter bloc.…
Vincent Agbo
  • 43
  • 1
  • 8
0
votes
2 answers

Flutter bloc - Show snackbar on state change

I am trying to log in with Google. When googleSignInAccount I yield new state with PlatformExecption. Now, How can I access that value in order to do some changes. try{ final GoogleSignInAccount googleSignInAccount = await…
Ashim Bhadra
  • 268
  • 4
  • 14