BLoC Not Working
Opened this issue · 2 comments
rafahsolis commented
Hi! Thanks for the code, i tried to run but i got the following error from the compiler:
file:///opt/flutter_v1.0.0/.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_v1.0.0/.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({
^
Failed to load "/home/rafa/AndroidStudioProjects/youtube_search_tutorial/test/ui/search/search_bloc_test.dart":
Compilation failed
Test: /home/rafa/AndroidStudioProjects/youtube_search_tutorial/test/ui/search/search_bloc_test.dart
Shell: /opt/flutter_v1.0.0/bin/cache/artifacts/engine/linux-x64/flutter_tester
dart:async/stream_controller.dart 595:43 _StreamController.addError
dart:async/stream_controller.dart 862:13 _StreamSinkWrapper.addError
package:stream_channel/src/guarantee_channel.dart 140:14 _GuaranteeSink._addError
package:stream_channel/src/guarantee_channel.dart 131:5 _GuaranteeSink.addError
package:flutter_tools/src/test/flutter_platform.dart 552:27 _FlutterPlatform._startTest
===== asynchronous gap ===========================
dart:async/zone.dart 1053:19 _CustomZone.registerUnaryCallback
dart:async/runtime/libasync_patch.dart 77:23 _asyncThenWrapperHelper
package:flutter_tools/src/test/flutter_platform.dart _FlutterPlatform._startTest
package:flutter_tools/src/test/flutter_platform.dart 462:36 _FlutterPlatform.loadChannel
package:flutter_tools/src/test/flutter_platform.dart 417:46 _FlutterPlatform.load
===== asynchronous gap ===========================
dart:async/zone.dart 1053:19 _CustomZone.registerUnaryCallback
dart:async/runtime/libasync_patch.dart 77:23 _asyncThenWrapperHelper
package:test_core/src/runner/loader.dart Loader.loadFile.<fn>
package:test_core/src/runner/load_suite.dart 98:31 new LoadSuite.<fn>.<fn>
===== asynchronous gap ===========================
dart:async/zone.dart 1045:19 _CustomZone.registerCallback
dart:async/zone.dart 962:22 _CustomZone.bindCallbackGuarded
dart:async/timer.dart 52:45 new Timer
dart:async/timer.dart 87:9 Timer.run
dart:async/future.dart 174:11 new Future
package:test_api/src/backend/invoker.dart 399:21 Invoker._onRun.<fn>.<fn>.<fn>
Im running it with:
Framework • revision 007a415c2a (5 days ago) • 2019-02-21 20:22:47 -0800
Engine • revision f1f19bba8f
Tools • Dart 2.2.0 (build 2.2.0-dev.2.1 c92d5ca288)
¿Any idea on what could be making this fail?
rafahsolis commented
I think i found the problem, it works with rxdart: 0.20.0 but not with rxdart 0.21.0
felangel commented
@rafahsolis just update the pubspec.yaml
to use the latest flutter_bloc
.
flutter_bloc: ^0.7.0
This was due to a breaking change in RxDart 0.21.0
. Sorry for the inconvenience!