Bloc: Error: No named parameter with the name 'seedValue'.

Created on 21 Feb 2019  Β·  19Comments  Β·  Source: felangel/bloc

I downloaded the "flutter_weather" example from here.And run "flutter packages get", I got an error after I run "flutter run"

_flutter: ══║ EXCEPTION CAUGHT BY WIDGETS LIBRARY β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
flutter: The following _CompileTimeError was thrown attaching to the render tree:
flutter: 'package:bloc/src/bloc.dart': error: line 24 pos 44:
flutter: file:///Users/xxxxx/flutter/.pub-cache/hosted/pub.dartlang.org/bloc-0.7.8/lib/src/bloc.dart:24:44:
flutter: Error: No named parameter with the name 'seedValue'.
flutter: _stateSubject = BehaviorSubject(seedValue: initialState);
flutter: ^^^^^^^^^
flutter: _stateSubject = BehaviorSubject(seedValue: initialState);

I don't understand what this problem means. Someone who knows?? Please help me

bug

Most helpful comment

I'm just going to publish an update of flutter_bloc and angular_bloc that forces the latest bloc version which should solve everyone's problems. Give me 5 mins and it should be ready.

All 19 comments

Hey @MorLightJ, just now took a clone and it works like charm. Worth to check by doing a flutter clean and get packages again. Also check the bloc package path in pubspec.yaml file
flutter_bloc: path: ../../packages/flutter_bloc
My bloc package version in external libraries when I get packages is bloc-0.9.3.
Hope these findings may help you. Cheers!

@dhar619 I ran "flutter clean",and get packages again. The same error..
How can I upgrade the bloc version at this path "file:///Users/xxxxx/flutter/.pub-cache/hosted/pub.dartlang.org/bloc-0.7.8/lib/src/bloc.dart:24:44:" ?

@MorLightJ I am new to flutter mate, still digging on it. My path is flutter_bloc: path: ../../packages/flutter_bloc The package came from the repo https://github.com/felangel/bloc/tree/master/packages/flutter_bloc

@MorLightJ this is a duplicate of #104. The problem is rxdart v0.21.0 introduced breaking changes so you should just need to use bloc v0.9.3.
Try deleting your .packages and pubspec.lock and then running flutter packages get. Somehow it seems like you're using bloc v0.7.8 which is really old.

Let me know if that helps.

Same issue, works on my mac, but not in CI.

@Ogiwara-CostlierRain464 did you try running flutter clean first?

Does flutter clean step is required for CI?

I'm just going to publish an update of flutter_bloc and angular_bloc that forces the latest bloc version which should solve everyone's problems. Give me 5 mins and it should be ready.

By adding bloc: ^0.9.3 to pubspec.yaml, it works!

@Ogiwara-CostlierRain464 yeah something weird is happening with the pubspec version resolution. flutter_bloc requires bloc ^0.9.0 which should take the latest 0.9.x but it seems like it's not working as expected for some people. As soon as #107 is merged everything should just work without having to manually add bloc: ^0.9.3

So I was using flutter_bloc: ^0.6.2,and
local machine was using bloc-0.9.3but CI was using other version of bloc.

Please update to the latest version of flutter_bloc and angular_bloc and things should be back to normal.

  dependencies:
    flutter_bloc: ^0.6.3
  dependencies:
    angular_bloc: ^0.4.3

@MorLightJ, @dhar619 , @Ogiwara-CostlierRain464 can you please confirm that things are working? I'll keep this open until then.

I'm running CI at here

...and also at here

(former is building android on Bitrise, latter is building ios on Azure Pileline)

@felangel works like a charm at my end. Thanks! πŸ‘

It's working, Thanks!πŸ‘

Closing this for now.
@MorLightJ if you're still having trouble just let me know! πŸ‘

Thanks, It works.

Was this page helpful?
0 / 5 - 0 ratings