bloc

Awaiting some results before dispatching an event with flutter_bloc library

↘锁芯ラ 提交于 2021-02-10 12:01:36
问题 I am trying to create a BLOC which depends on two other time based bloc and a non-time based bloc. What i mean with time based is, for example they are connecting a remote server so it takes time. It's working just like this: Login (It's of course taking some time) If login is successful Do another process (This is something takes time also. It returns a future.) After login and another process finishes, let the page know it. My BLOC depends on these three: final UserBloc _userBloc; final

Awaiting some results before dispatching an event with flutter_bloc library

旧街凉风 提交于 2021-02-10 11:58:26
问题 I am trying to create a BLOC which depends on two other time based bloc and a non-time based bloc. What i mean with time based is, for example they are connecting a remote server so it takes time. It's working just like this: Login (It's of course taking some time) If login is successful Do another process (This is something takes time also. It returns a future.) After login and another process finishes, let the page know it. My BLOC depends on these three: final UserBloc _userBloc; final

Awaiting some results before dispatching an event with flutter_bloc library

我的未来我决定 提交于 2021-02-10 11:58:08
问题 I am trying to create a BLOC which depends on two other time based bloc and a non-time based bloc. What i mean with time based is, for example they are connecting a remote server so it takes time. It's working just like this: Login (It's of course taking some time) If login is successful Do another process (This is something takes time also. It returns a future.) After login and another process finishes, let the page know it. My BLOC depends on these three: final UserBloc _userBloc; final

Awaiting some results before dispatching an event with flutter_bloc library

喜你入骨 提交于 2021-02-10 11:57:35
问题 I am trying to create a BLOC which depends on two other time based bloc and a non-time based bloc. What i mean with time based is, for example they are connecting a remote server so it takes time. It's working just like this: Login (It's of course taking some time) If login is successful Do another process (This is something takes time also. It returns a future.) After login and another process finishes, let the page know it. My BLOC depends on these three: final UserBloc _userBloc; final

How to filter a list of obseravble in rxdart

房东的猫 提交于 2021-02-08 19:41:59
问题 I am trying to implement bloc pattern in rxdart . I am trying to build todo app type of app . I implemented showing all items in list but what I want is not to show completed and uncompleted items in different part . However I am not able to filter the items based on completed on rxdart . import 'package:rxdart/rxdart.dart'; import '../models/ShoppingItem.dart'; class ShoppingItemBloc { final _shoppingItems = BehaviorSubject<List<ShoppingItem>> (seedValue: []); Observable<List<ShoppingItem>>

How to filter a list of obseravble in rxdart

梦想的初衷 提交于 2021-02-08 19:39:10
问题 I am trying to implement bloc pattern in rxdart . I am trying to build todo app type of app . I implemented showing all items in list but what I want is not to show completed and uncompleted items in different part . However I am not able to filter the items based on completed on rxdart . import 'package:rxdart/rxdart.dart'; import '../models/ShoppingItem.dart'; class ShoppingItemBloc { final _shoppingItems = BehaviorSubject<List<ShoppingItem>> (seedValue: []); Observable<List<ShoppingItem>>

The superclass 'Bloc<xxx, xxx>' doesn't have a zero argument constructor in dart

安稳与你 提交于 2021-02-07 18:46:43
问题 I am a beginner in Dart language development. I try to create a sample flutter application BLOC pattern inspired by this GitHub repo, but I got some error message related to the class inheritance. I am already familiar with the inheritance and superclass and subclass programming in the dot net C# language. But in the case of the dart, I need some advice. Here is my code: class UserRegBloc extends Bloc<UserRegEvent, UserRegState> { UserRepository userRepository; UserRegBloc({@required

The superclass 'Bloc<xxx, xxx>' doesn't have a zero argument constructor in dart

China☆狼群 提交于 2021-02-07 18:46:22
问题 I am a beginner in Dart language development. I try to create a sample flutter application BLOC pattern inspired by this GitHub repo, but I got some error message related to the class inheritance. I am already familiar with the inheritance and superclass and subclass programming in the dot net C# language. But in the case of the dart, I need some advice. Here is my code: class UserRegBloc extends Bloc<UserRegEvent, UserRegState> { UserRepository userRepository; UserRegBloc({@required

error: The argument type '(int) → dynamic' can't be assigned to the parameter type '(String) → void'

爷,独闯天下 提交于 2021-01-29 11:24:12
问题 I have some fields which post String and int , the String fields are working properly and I am getting these values at the db, the at the int type fields I'm getting this error message. The argument type '(int) → dynamic' can't be assigned to the parameter type '(String) → void'. I'm using bloc to post to a firebase db. here is how it looks. Widget build(BuildContext context) { final trackerBloc = Provider.of<TrackerBloc>(context); String docId = DateTime.now().millisecondsSinceEpoch.toString

How can i make a new stream of other streams returning a list of all the values emitted (bloc pattern)?

别来无恙 提交于 2021-01-29 10:40:15
问题 I have three streams like this: final _light1RoomCtlr = BehaviorSubject<String>(); final _light2RoomCtlr = BehaviorSubject<String>(); final _light3RoomCtlr = BehaviorSubject<String>(); Stream<String> get getLight1Room => _light1RoomCtlr.stream; Function(String) get setLight1Room => _light1RoomCtlr.sink.add; Stream<String> get getLight2Room => _light2RoomCtlr.stream; Function(String) get setLight2Room => _light2RoomCtlr.sink.add; Stream<String> get getLight3Room => _light3RoomCtlr.stream;