RxDart: исключение при создании субъекта

Я использую RxDart добавить функциональность над async:dart в моем приложении Флаттер.

Я вижу это исключение:

I/FlutterActivityDelegate( 5299): onResume setting current activity to this
E/flutter ( 5299): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter ( 5299): 'dart:async/stream.dart': error: line 942: signature type '(TypeToken) => Observable' of function 'cast' is not a subtype of signature type '() => Stream' of function 'cast'
E/flutter ( 5299): 
E/flutter ( 5299):   Stream < R > cast < R >() {
E/flutter ( 5299):   ^
E/flutter ( 5299): 'package:rxdart/src/observable.dart': error: line 1156: class 'Observable' overrides method 'cast' of super class or interface 'Stream' with incompatible parameters
E/flutter ( 5299):   Observable < S > cast < S >(TypeToken < S > typeToken) =>
E/flutter ( 5299):   ^
E/flutter ( 5299): 
E/flutter ( 5299): #0      new MobileAuthentication (package:lib.frontend.apps.mobile.authentication/src/authentication/authenticator/mobile_authentication.dart:14)
E/flutter ( 5299): #1      MobileContext.setupProduction (file:///Users/marc/BasicWindow/source/monorepo/dart/projects/nightpal/mobile/lib/src/app/context.dart:9)
E/flutter ( 5299): #2      ContextBase.setup (package:nightpal.shared/src/app/context.dart:33)
E/flutter ( 5299): #3      main (file:///Users/marc/BasicWindow/source/monorepo/dart/projects/nightpal/mobile/lib/main.dart:7)
E/flutter ( 5299): #4      _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:279)
E/flutter ( 5299): #5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
I/FlutterActivityDelegate( 5299): onResume setting current activity to this

Я создаю такую ​​тему в классе:

class _State extends AuthenticationStateBase<SignInPage> implements ISignInView {

  final PublishSubject _onSignIn = new PublishSubject();
  @override Observable<SignInEvent> get onSignIn => _onSignIn.observable;

  _State(IController<IView> controller) : super(controller);
  //...
}

Строка 14 в ошибке, где я создаю PublishSubject,

В моем pubspec.yaml У меня есть зависимость rxdart: ^0.15.0

0 ответов

Другие вопросы по тегам