felangel / bloc

A predictable state management library that helps implement the BLoC design pattern
https://bloclibrary.dev
MIT License
11.8k stars 3.39k forks source link

Error using RxDart 0.21.0 #104

Closed chip2n closed 5 years ago

chip2n commented 5 years ago
bloc.dart:24:44: Error: No named parameter with the name 'seedValue'.

This is most likely due to the following breaking change (from the changelog):

BehaviorSubject now has a separate factory constructor seeded()

yuyoDev commented 5 years ago

Today I found the same mistake, and yesterday everything worked perfect,

bloc.dart:24:44: Error: No named parameter with the name 'seedValue'. _stateSubject = BehaviorSubject(seedValue: initialState);

wm17 commented 5 years ago

I've encountered the same issue. Any object that extends Bloc causes the issue, as the offending line is in the Bloc constructor (bloc.dart:24:44). It appears that BehaviorSubject<State>(seedValue: initialState) should now be BehaviorSubject.seeded(initialState) in rxdart 0.21.0 onwards.

felangel commented 5 years ago

This is due to a breaking change in v0.21.0 of rxdart as @chip2n and @wm17 pointed out.

105 will address this. I'll let everyone know when I've published the change. In the meantime you can just add a restriction for rxdart in your own pubspec.yaml to resolve this.

dependencies:
  rxdart: ">=0.18.1 <0.21.0"
felangel commented 5 years ago

Update: this is now fixed in bloc v0.9.3 so you should be able to just do a flutter packages get and the issue should be resolved.