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

Flutter - How set double value to Bloc?

In my application there is a field for input of a certain value in double format, but this is not working. What am I doing wrong? My Bloc class BudgetBloc extends BlocBase { String _documentId; double _movimentos; BudgetBloc() { …
Marcio
  • 1,685
  • 3
  • 24
  • 39
0
votes
0 answers

Two Bloc Builders in one page (Screen)

How to show two different bloc builder in one page by using flutter_bloc package.For example i have created a row,in that row there is two columns. Each column has a separate bloc builder. But when i do this the first column builder shows but in the…
mohammed nabil
  • 475
  • 2
  • 14
  • 27
0
votes
0 answers

Many BlocListener Registered with Navigation.pushName() on Flutter

I have a problem with register of BlocListener with Flutter_bloc I have 3 Widget, let's say Widget1, Widget2 and Widget3. In Widget1 that is a initialRoute I have registered my BlocListener for SnackBar: class Widget1 extends StatelessWidget{ …
LorenzoBerti
  • 6,704
  • 8
  • 47
  • 89
0
votes
2 answers

How to use Flutter Bloc with Firebase Phone Auth

I'm trying to implement Firebase phone authorization using Flutter Bloc pattern. I have the following code import 'dart:async'; import 'package:bloc/bloc.dart'; import 'package:firebase_auth/firebase_auth.dart'; import './bloc.dart'; class AuthBloc…
Vladislav
  • 273
  • 3
  • 15
0
votes
2 answers

Multi BlocBuilder in Flutter

I am a beginner in flutter and is there any examples or documentations which related to multi blocbuilder in one page by using flutter_bloc package in Flutter.
SOUGAT RIYADH
  • 562
  • 2
  • 10
  • 26
0
votes
1 answer

How to get data from api by using flutter_bloc package

How to get the data from api after clicking on button. Basically there is two screens HomePage and SettingsPage, each page has a seperate bloc and a repository. Homepage is the launch screen which automatically fetch api without clicking any button…
SOUGAT RIYADH
  • 562
  • 2
  • 10
  • 26
0
votes
1 answer

Flutter – MultiBlocProvider doesn't instantiate BLoC

So I have this code @override Widget build(BuildContext context) { return MultiBlocProvider( providers: [ BlocProvider( create: (context) => ProfilePageBloc(userRepository: UserRepository.instance), ), …
Bartek Pacia
  • 1,085
  • 3
  • 15
  • 37
0
votes
2 answers

Flutter Bloc: state transition

I am facing an issue in my Bloc. In the app, user can filter by multiple values. When I use filter, transition is done correctly, but when I used filter2, nothing is happening and state is not rebuilt in BlocBuilder. Am I missing something? What is…
Stepan
  • 1,041
  • 5
  • 23
  • 35
0
votes
1 answer

How to handle communication between Blocs

I'm working with the flutter_bloc library. Imagine the situation, that you are navigating deep in your app and every screen on the navigationstack presents data (slightly differnet because otherwise it wouldn't make sense), that can be modified by…
Daniel Wei
  • 51
  • 4
0
votes
1 answer

Not able to Listen New Value From Bloc Flutter

I'm using flutter_bloc library to manage the state of the app, as I press a button in a different class state changes in bloc class but not able to listen in BlocProvider in build method. BlocBuilder( builder: (context,…
Atiq Ur Rehman
  • 1,065
  • 1
  • 15
  • 34
-1
votes
1 answer

Why is Bloc state not updating when using reactive_forms in flutter?

I am using flutter with reactive_forms package and BLoC. I tried to outsource the FormGroup to BLoC state class and providing it to the ReactiveFormBuilder using BlocBuilder widget. Flutter Bloc - Profile State: BLOC STATE class ProfileState extends…
-1
votes
3 answers

Please comment on 3 flutter_bloc writing styles: BlocBuilder, BlocListener, BlocConsumer

I am practicing with flick_bloc and I wonder when to use BlocBuilder, when to use BlocListener and when to use BlocConsumer. I asked a few people, they said that BlocBuilder is used the most and I also started and just practiced with it, but it…
lllionlll
  • 57
  • 6
-1
votes
1 answer

Json List show in the console but flutter says the list is empty

I'm working with an API to create a movie app with flutter. I'm using the Bloc library for state management but I have an issue displaying the json response on my UI because flutter somehow thinks the list is empty even though the json list prints…
-1
votes
1 answer

Flutter bloc - Casting issue

I have an issue when trying to update a bloc's state locally. I am trying to retrieve the state to manipulate the data and then emit a new state so it reflects those changes in the UI. I am not trying to manipulate the state itself just the…
Matias
  • 708
  • 10
  • 24
-1
votes
1 answer

How can i fix my app which been crashed by my custom exception. i think

so intentionally passes wrong parameters in my code to get the user not found exception. but when my code catches the error in the bloc and tries to emit the failure state the app crashes and no state is emitted this is the call stack i get…
olu
  • 93
  • 7