Category "bloc"

How to get data from a repository from within a cubit?

i'm using flutter bloc. i want to emit the data from a repo to a state. how do i get the data from the repo to show in the cubit? This is my cubit: void getPro

how to access flutter bloc in the initState method?

In the code shown below , the dispatch event is called from within the build method after getting the BuildContext object. What if I wish to do is to dispatch a

How to change the application language with BlockBuilder?

The application needs to implement language switching at runtime. Wrote a bloc with event and state and called BlocBuilder in main.dart. But I don't know how to

How To Listen to BLoC Events From Another Screen in Flutter

SOLVED: I WAS GETTING ANOTHER STATE INSTEAD OF WHAT I EXPECTED I have two screens in my app. The first one contains products and each one of them is wrapped wit

Is this the correct way to use Bloc in flutter?

How to use Bloc in flutter. What is the best way to use it? to wrap the whole app with blocprovider? runApp( RepositoryProvider( create: (contex

ListView not displaying item with BLoC pattern

I'm a flutter beginner and I'm currently working on an app that let me take a photo and then update a ListView to display the photo with a little text descripti

( Flutter Bloc ) doesn't conform to the bound 'StateStreamable<state>' of the type parameter 'B'

why am i getting the error? I couldn't find the reason. I'll be happy if you can help me. error screen You can check my issue on github

how to reuse previous state fields in flutter bloc pattern?

have the following. using sliding_up_panel that has body with messages and with a different view in panel content that pops up on click action from bottom bar.

How to access Provided (Provider.of()) value inside showModalBottomSheet?

I have a FloatingActionButton inside a widget tree which has a BlocProvider from flutter_bloc. Something like this: BlocProvider( builder: (context) { So

command 'extension.new-bloc' not found

I am a Flutter developer. I am using VS Code for bloc module generation. I tried to use the "Bloc: New Bloc" from the context menu, but it fails every time.

Why loadInitTopStory method called after calling loaded state in flutter?

HackerNewsLoadedState is called before HackerNewsLoadingState and it loads all data from API but does not integrate to _topStories list as well as store data to

How to have single instance of a bloc across other blocs

How can I avoid creating another instance of some bloc class? I have two blocs: LoginBloc and AuthBloc . and LoginBloc accepts an instance of AuthBLoc and here