Bloc: Any RxOperator e.g. debounceTime or mergeWith isn't defined for type Stream

Created on 1 Jun 2020  路  3Comments  路  Source: felangel/bloc

Describe the bug
I am trying out an example of flutter_firebase_login and I am getting the following error when trying to use any Rx operator over type Stream in LoginBloc class.

For reference, I have copy-pasted exact same code in my file.
https://github.com/felangel/bloc/blob/master/examples/flutter_firebase_login/lib/login/bloc/login_bloc.dart

I have defined the following dependencies in pubspec.yaml file

rxdart: ^0.23.1
flutter_bloc: ^4.0.0 #Bloc architecture pattern
meta: ^1.1.6
equatable: ^1.1.1

I am not sure what exactly is missing in order to usee Rx operator with Stream.
I'd like to thank in advance for any suggestion to fix this issue.

question

Most helpful comment

Hi @RollyPeres Thanks for the answer.
@felangel Thanks it's was a rxdart import issue. Adding package:rxdart/rxdart.dart solves my issue. Somehow it was not auto imported by my IDE (i.e. Android Studio)

All 3 comments

Hi 馃憢

You might have some incompatibilities between your packages, pay attention to output console for that.
Try using the latest version of rxdart which is 0.24.1

Hi @shubhambansal 馃憢
You need to add rxdart as a dependency as @RollyPeres mentioned and make sure you鈥檝e imported package:rxdart/rxdart.dart 馃憤

Hi @RollyPeres Thanks for the answer.
@felangel Thanks it's was a rxdart import issue. Adding package:rxdart/rxdart.dart solves my issue. Somehow it was not auto imported by my IDE (i.e. Android Studio)

Was this page helpful?
0 / 5 - 0 ratings