Questions tagged [rxdart]

Reactive extensions on top of Dart streams.

Provides Reactive extensions on top of Dart streams.

Similar to RXjs

https://pub.dartlang.org/packages/rxdart

325 questions
39
votes
7 answers

Observable is deprecated in rxdart 0.23.1

I just upgraded to rxdart 0.23.1 and suddenly I am getting errors wherever I have used the Observable class. I have read about the breaking changes in the documentation and it has specified to use the rxdart_codemod package which I have integrated…
BraveEvidence
  • 53
  • 11
  • 45
  • 119
18
votes
2 answers

Navigating to a new screen when stream value in BLOC changes

In Flutter how would I call Navigator.push when the value of a stream changes? I have tried the code below but get an error. StreamBuilder( stream: bloc.streamValue, builder: (BuildContext context, AsyncSnapshot snapshot) { …
Arizona1911
  • 2,181
  • 9
  • 29
  • 38
15
votes
1 answer

When is ChangeNotifier prefered over an Observable in Flutter?

I've been struggling to understand when ChangeNotifier is preferred over Rxdart's Observable, or streams in general. According to Flutter's docs: A class that can be extended or mixed in that provides a change notification API using VoidCallback…
Eliya Cohen
  • 10,716
  • 13
  • 59
  • 116
13
votes
2 answers

how to get last value in a Stream using rxdart?

I have a stream that holds string values and i want to get the last value in that string. what's the best way to do it? Stream get searchTextStream { return _searchController.stream.transform( StreamTransformer
Salma
  • 1,211
  • 2
  • 16
  • 33
13
votes
6 answers

flutter snackbar display based on stream

I currently have an interesting issue related to displaying of a snackbar based on a user action. Above sounds very trivial, but lets elaborate: I have 2 screens: list of employees Add employee The application uses the bloc pattern (with…
Joey Roosing
  • 2,145
  • 5
  • 25
  • 42
12
votes
4 answers

The body might complete normally, causing 'null' to be returned, but the return type is a potentially non-nullable type

I'm using new dart version >=2.12.0 <3.0.0 with null safety enabled. I have added my code for reference. MatchesService import 'package:cric_app/AppUrls.dart'; import 'package:cric_app/features/home/match_model.dart'; import…
Pranav Kumar K
  • 187
  • 1
  • 1
  • 10
12
votes
3 answers

How to update value for TextField using StreamBuilder?

I have a textfield and i am using sqflite database in my app. The sqflite has a value which i need to assign to my textfield Here is my textfield code StreamBuilder( stream: patientHealthFormBloc.doctorName, builder: (context,…
BraveEvidence
  • 53
  • 11
  • 45
  • 119
12
votes
1 answer

Is nested StreamBuilder good pattern?

I am fetching articles from HackerNews API using Bloc Pattern and Streams. I am loading all the articles and presenting in the UI with the help of a stream builder, and this works fine. Now I wrapped the article fetching Stream builder with the new…
Dhruvam Sharma
  • 1,661
  • 14
  • 22
12
votes
6 answers

Flutter merge two firestore streams into a single stream

I simply want to perform an 'OR' operation and get the both results of two queries into one stream. Here's my code with a single stream StreamBuilder( stream: Firestore.instance .collection('list') .where('id', isEqualTo:…
12
votes
2 answers

Bad state: You cannot close the subject while items are being added from addStream in flutter

I am using RxDart to observe changes and update the UI accordingly. When the app launches I am making a network call and successfully getting the data, observe the changes and update the UI accordingly. But when I am disposing the Subjects while…
sagar suri
  • 4,351
  • 12
  • 59
  • 122
11
votes
1 answer

Dart: convert Observable to Future and vice-versa?

How can I convert a Dart Observable to a Future and vice-versa?
Daniel Oliveira
  • 8,053
  • 11
  • 40
  • 76
11
votes
1 answer

Flutter - How to architect multiple nested BLoC?

Suppose there is a top-level BLoC called PreferenceBloc, and inside that BLoC is another BLoC called PageBloc. If the logic inside PageBloc requires on a value stream from PreferenceBloc (i.e., create a new page needs to know page configuration…
First_Strike
  • 1,029
  • 1
  • 10
  • 27
9
votes
4 answers

Check if StreamSubscription is canceled

To put it simple: How do i check if a StreamSubscription is canceled? There is no _myCustomSub.isCanceled
Marc Ma
  • 318
  • 2
  • 12
9
votes
2 answers

Getting current value from Stream

There is a StreamBuilder (using RxDart) which displays some date. After click on InkWell widget I need to calculate a new date on basis of old one. The code below simply explains the algo but when I run it there is nothing happens and execution…
BambinoUA
  • 6,126
  • 5
  • 35
  • 51
9
votes
5 answers

Throttle function execution in dart

Is there a way in Dart to throttle function execution like this Observable.throttle(myFunction,2000);
Shady Aziza
  • 50,824
  • 20
  • 115
  • 113
1
2 3
21 22