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

Update BlocProvider to Automatically Dispose Bloc #349

Merged
merged 1 commit into from
Jun 14, 2019

Conversation

felangel
Copy link
Owner

Status

READY

Breaking Changes

YES

Description

Go from:

BlocProvider(
    builder: (context) => CounterBloc(),
    dispose: (context, bloc) => bloc.dispose(),
    child: Container(),
)

to

BlocProvider(
    builder: (context) => CounterBloc(),
    child: Container(),
)

And from:

BlocProvider(
    builder: (context) => CounterBloc(),
    dispose: (context, bloc) => null,
    child: Container(),
)

to

BlocProvider(
    builder: (context) => CounterBloc(),
    dispose: false,
    child: Container(),
)

Todos

  • Tests
  • Documentation
  • Examples

Impact to Remaining Code Base

Breaking API Change to BlocProvider which will be released in flutter_bloc v0.17.0

@felangel felangel added the enhancement New feature or request label Jun 13, 2019
@felangel felangel requested a review from jorgecoca June 13, 2019 22:40
@felangel felangel self-assigned this Jun 13, 2019
@codecov
Copy link

codecov bot commented Jun 13, 2019

Codecov Report

Merging #349 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #349   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines         180    181    +1     
=====================================
+ Hits          180    181    +1
Impacted Files Coverage Δ
packages/flutter_bloc/lib/src/bloc_provider.dart 100% <100%> (ø) ⬆️

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 b0d7b7a...0a51124. Read the comment docs.

@felangel felangel merged commit 037b4d4 into master Jun 14, 2019
@felangel felangel deleted the feature/blocprovider-auto-dispose branch June 14, 2019 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant