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

commented Jun 13, 2019

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 requested a review from jorgecoca Jun 13, 2019

@felangel felangel self-assigned this Jun 13, 2019

@felangel felangel added this to In progress in bloc Jun 13, 2019

@codecov

This comment has been minimized.

Copy link

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

4 checks passed

codecov/patch 100% of diff hit (target 100%)
Details
codecov/project 100% (+0%) compared to b0d7b7a
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@felangel felangel deleted the feature/blocprovider-auto-dispose branch Jun 14, 2019

@felangel felangel moved this from In progress to Done in bloc Jun 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1 participant
You can’t perform that action at this time.