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

flutter_bloc: Fix provider exception #1286

Merged
merged 1 commit into from
Jun 11, 2020

Conversation

ookami-kb
Copy link
Contributor

Status

READY

Breaking Changes

NO

Description

If BLoC depends on something injected with Provider and it's not lazily created, the exception is wrapped into FlutterError and provides description related to BlocProvider. That is wrong and confusing for the client as the problem is not in missing BLoC.

This PR fixes the error by checking the valueType of the thrown exception.

Todos

  • Tests
  • Documentation
  • Examples

@ookami-kb ookami-kb requested a review from felangel as a code owner June 11, 2020 21:34
@ookami-kb ookami-kb changed the title Fix provider exception flutter_bloc: Fix provider exception Jun 11, 2020
@codecov
Copy link

codecov bot commented Jun 11, 2020

Codecov Report

Merging #1286 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1286   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          143       144    +1     
=========================================
+ Hits           143       144    +1     
Impacted Files Coverage Δ
packages/flutter_bloc/lib/src/bloc_provider.dart 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b895443...7306d9f. Read the comment docs.

Copy link
Owner

@felangel felangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I really appreciate it 💯

@felangel felangel merged commit c02d543 into felangel:master Jun 11, 2020
@felangel felangel added bug Something isn't working pkg:flutter_bloc This issue is related to the flutter_bloc package labels Jun 11, 2020
@felangel felangel added this to In progress in bloc via automation Jun 11, 2020
@felangel felangel moved this from In progress to Done in bloc Jun 11, 2020
@ookami-kb ookami-kb deleted the fix-provider-exception branch June 11, 2020 21:43
@felangel felangel mentioned this pull request Jun 13, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:flutter_bloc This issue is related to the flutter_bloc package
Projects
bloc
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants