bloc Questions

1

Solved

I'm using the BLOC pattern to authenticate a user in my app. I have a main BlocProvider that wraps my app. And a BlocBuilder to build according to the authentication state. If the user is unauthent...
Asternal asked 24/8, 2020 at 11:50

1

Solved

I'm writing an app using BLOC architecture and registered bloc providers like this in the main.dart: runApp(MultiBlocProvider(providers: [ BlocProvider<OrderBloc>( create: (context) { retu...
Rocaille asked 12/8, 2020 at 12:28

1

Solved

Context I come from Redux and I am learning the BLoC pattern for global state management. I am having troubles defining where should I store values as properties inside the BLoC class, and when I s...
Decameter asked 11/8, 2020 at 13:44

3

Solved

I am using the flutter_bloc package to manage state in my app. I have a usecase where I have to load the initial state from the remote DB. This requires the initialState method to be async, which i...
Actinopod asked 24/2, 2020 at 5:57

2

Solved

I am implementing Reso Coder's clean architecture in flutter. I followed his guides in dividing the project to layers and using dependency injection. In one of the cases I want to have the followin...
Gemina asked 9/3, 2020 at 8:4

2

Solved

So I am reading through Bloc for state management for flutter. Since Bloc allows you to sink and stream (rebuilding a widget based on the input), then is it possible to build an app mostly with st...
Robillard asked 14/11, 2019 at 20:0

2

This is my change password screen. I was using flutter_bloc for implementing mvvc pattern. This page works fine with bloc. But what I am trying to achieve is validate form when submitting the form....
Rodriques asked 18/2, 2020 at 9:40

4

I would like to mock my Bloc in order to test my view. For example, this is my Bloc: class SearchBloc extends Bloc<SearchEvent, SearchState> { @override // TODO: implement initialState S...
Laing asked 19/3, 2019 at 8:11

1

Solved

How can I yield a state from the recurring callback of a Timer? I have a Timer object in my class and when user hits start, a new object of it is created, and inside it's callback I need to call y...
Olia asked 13/6, 2020 at 12:23

2

Solved

I tried to load array json (array with no key) and fetch into list of object, here is my sample code : My ApiCliet : Future<List<OnBoardingModel>> fetchOnboarding() async { try { Re...
Logogriph asked 6/6, 2020 at 4:11

3

I'm having trouble implementing BLoC in flutter, i followed this tutorial: https://github.com/ResoCoder/youtube-search-flutter-bloc But i get the following compiler message that i haven't been abl...
Herewith asked 26/2, 2019 at 17:42

1

I am learning state management in flutter and most of the time I encounter with words business logic ui logic and some time presentation logic, I searched it on the internet as people explain it in...
Messaline asked 21/5, 2020 at 5:13

0

I am new to Flutter and the BLoC design pattern. However, the concept of BLoC looks pretty straightforward and I think I understand it pretty well. Occasionally, when reviewing my coworkers' code,...
Haarlem asked 11/5, 2020 at 6:16

1

Solved

I'm facing issue in my current project so created this question im unable to get same bloc state in other widget i tried this https://github.com/felangel/bloc/issues/74#issuecomment-457968962 but i...
Loralyn asked 30/4, 2020 at 16:21

2

Solved

hello I am new in flutter and bloc, I imagine that I have 2 screens (login and home screen). In login screen I am using bloc that post data and I want to call that data in my home screen. Can someo...
Sheriesherif asked 1/4, 2020 at 2:1

1

I am using inject.dart to inject my bloc as a singleton, is it a bad practice i.e that causes memory leak? Since all the streams I am using are Broadcast Streams from RxDart I was wondering if a s...
Fontaine asked 31/10, 2019 at 13:40

1

I am working through many of the tutorials out there on bloc with flutter and running into some inconsistencies. I am using Android studio and creating the bloc code by using the plugin from Inte...
Kingsize asked 16/3, 2020 at 6:55

1

I want to create a TextField that check if the value exist in database. How to do async validation using BLOC pattern with TextField widget? Should I use StreamTransformer to add error to the Stre...
Defalcation asked 26/12, 2018 at 7:34

1

Solved

I've recently read about BLoC (Business Logic Component), and I'm building an app to retrieve data from api, I'm wondering when should I create a bloc and when I shouldn't, using the Flutter_BLoC p...
Saccharate asked 1/3, 2020 at 16:31

1

Solved

I'm starting with flutter as I want to port my swift app to Flutter, but I'm getting stuck understanding the pattern Bloc/Repository/Firebase as I'm following the tutorial https://bloclibrary.dev/#...
Halve asked 23/2, 2020 at 16:20

2

Solved

in flutter i just learn how can i use Bloc on applications and i want to try to implementing simple login with this feature. after implementing some class of bloc to using that on view i get erro...
Buffon asked 12/5, 2019 at 8:29

1

Solved

I am learning the bloc pattern for Flutter and there seems to be a recurring piece of advice that "every screen should have its own bloc". But what if you queried your server for data that will b...
Hahn asked 24/1, 2020 at 0:47

2

Solved

my main.dart file looks like this. home: MultiBlocProvider( providers: [ BlocProvider<UserBloc>( create: (BuildContext context) => UserBloc()..add(GetUser(userId:"5e0b62023b75dd60e22ed...
Ewan asked 7/1, 2020 at 17:38

1

My understanding of state management is that calling setState() alone opens up a variety of messy issues, code files become huge and difficult to debug, and it prevents holding a sensible structure...
Seleta asked 18/12, 2019 at 12:46

1

Solved

I know that BLoC in flutter acts like the viewmodel layer in android's MVVM, so the data does not gets fetched again and again upon configuration changes (for ex: change in screen orientation). I...
Thirddegree asked 10/6, 2019 at 21:7

© 2022 - 2024 — McMap. All rights reserved.