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 able to debug:
Compiler message:
file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/bloc-0.8.4/lib/src/bloc.dart:24:44: Error: No named parameter with the name 'seedValue'.
_stateSubject = BehaviorSubject<State>(seedValue: initialState);
^^^^^^^^^
file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/rxdart-0.21.0/lib/src/subjects/behavior_subject.dart:49:11: Context: Found this candidate, but the arguments don't match.
factory BehaviorSubject({
^
Compiler failed on /home/rafa/AndroidStudioProjects/news/lib/main.dart
Finished with error: Gradle task assembleDebug failed with exit code 1
Im using:
Flutter 1.2.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8661d8aecd (12 days ago) • 2019-02-14 19:19:53 -0800
Engine • revision 3757390fa4
Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
Any ideas on how to fix this error? Thanks!
I found the issue, rxdart: 0.21.0 has been refactored and breaks bloc 0.8.4, in order to fix this problem add rxdart: 0.20.0 as a dependency to pubspec.loc
I was able to fix this by using the most recent flutter_bloc dependency, which is currently flutter_bloc: ^0.8.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With