Skip to content
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

It is not possible for state to be null #1312

Closed
lucacasonato opened this issue Jun 17, 2020 · 3 comments · Fixed by #1302
Closed

It is not possible for state to be null #1312

lucacasonato opened this issue Jun 17, 2020 · 3 comments · Fixed by #1302
Assignees
Labels
breaking change Enhancement candidate would introduce a breaking change enhancement New feature or request pkg:bloc This issue is related to the bloc package
Projects
Milestone

Comments

@lucacasonato
Copy link

Describe the bug
It seems that at the moment bloc does not allow the state (initial or current) to be null. If either of them are null, this error occurs: Unhandled error 'package:bloc/src/transition.dart': Failed assertion: line 25 pos 16: 'currentState != null': is not true..

To Reproduce

  1. Create a Bloc component with an initial state of null.
  2. Yield any object in mapEventToState.
  3. See error

Expected behavior
I expect to be able to use null as a valid current state.

@narcodico
Copy link
Contributor

Hi @lucacasonato 👋

This is something that is already addressed in the new version of bloc package and will be available in v5.0.0. 👍

@lucacasonato
Copy link
Author

Awesome! Thanks for the quick response 🚀

Is there an ETA for the 5.0.0 release? I guess for now I can just import master via the git URL in my pubspec 😄

@felangel
Copy link
Owner

@lucacasonato I'm aiming to have 5.0.0-dev published by end of week 👍

@felangel felangel added breaking change Enhancement candidate would introduce a breaking change pkg:bloc This issue is related to the bloc package labels Jun 17, 2020
@felangel felangel added this to To do in bloc via automation Jun 17, 2020
@felangel felangel added this to the bloc-v5.0.0 milestone Jun 17, 2020
@felangel felangel moved this from To do to In progress in bloc Jun 17, 2020
@felangel felangel added the enhancement New feature or request label Jun 17, 2020
bloc automation moved this from In progress to Done Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Enhancement candidate would introduce a breaking change enhancement New feature or request pkg:bloc This issue is related to the bloc package
Projects
bloc
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants