-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flutter_bloc 6.0.1 (Current Latest) Breaks Constructor "AuthBloc(this._authFacade);" #6
Comments
Question: I get an error message 'The getter 'showErrorMEssages' was called on null. I got this message once I upgraded. |
With the following versions in dependencies and dev_dependencies in pubspec.yaml: dependencies: dev_dependencies: I get the following on "AuthBloc(this._authFacade);": The superclass 'Bloc<AuthBlocEvent, AuthBlocState>' doesn't have a zero argument constructor. Remember that you need to add the following override otherwise you will get a "requires the 'non-nullable' language feature to be enabled" error with build_runner: dependency_overrides: I presume that there is a bug in analyzer 0.39.15? |
I am just not getting it on your comment with related to AuthBoc. |
In bloc.dart... The Bloc definition in 4.0.0 is: abstract class Bloc<Event, State> extends Stream<State> implements Sink<Event> { ... /// {@macro bloc}
Bloc() {
_state = initialState;
_bindEventsToStates();
} ... The Bloc definition in 6.0.1 is:
abstract class Bloc<Event, State> extends Cubit<State>
implements EventSink<Event> {
/// {@macro bloc}
Bloc(State initialState) : super(initialState) {
_bindEventsToStates();
} ... Therefore you get the compile time error, "The superclass 'Bloc<AuthBlocEvent, AuthBlocState>' doesn't have a zero argument constructor." |
I was not clear or I have no clue at all. I am not getting a compile error, i think. It is runtime. If i down grade to return Form( The relevant error-causing widget was |
Okay, so there are at least 2 separate issues that need to be solved to upgrade the BLoC library to the latest version |
Yes. Does the fix need to be part of Bloc or the application? |
In the app to accommodate the breaking changes implemented in the BLoC library |
I will stay at 4.0.0 until there is a fix. I am working on an APP that stopped working with the New Bloc. |
@rdhillbb, not BLoC related, but may help in terms of understanding/implementing Clean Architecture and TDD:
|
All I did was take the finished code and upgraded to 6.0.1. No modifications. I will take your suggestions. |
Glad that worked. Thanks for the update. |
Thanks for the awesome tutorials. Please upgrade the project to the latest BLoC package.
The text was updated successfully, but these errors were encountered: