-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
flutter_bloc v0.20.0-rc #415
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #415 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 11 11
Lines 179 198 +19
=====================================
+ Hits 179 198 +19
Continue to review full report at Codecov.
|
|
These small improvements that you are adding everyday are just so enjoyable for the dev experience 👍 I don't get what the breaking change is ? 🤔 |
|
@axellebot thanks! I'm glad you think so 😄 Regarding the breaking change, I changed the generic templating so for developers who explicitly provided the types to OldBlocBuilder<CounterEvent, int>(...)NewBlocBuilder<CounterBloc, int>(...)For developers who omit these there will be no problems but it technically is still a breaking change. |
|
@felangel I like it, I prefer the state type can be inferred with only passing the bloc type but, |
|
Ho tricky ! I didn't see it ! So yeah definitely a breaking change ... It can be cool to inferred the state type but I guess there is no way to do so. |
0c42992 to
6fe4ec7
Compare
|
Did I read it correctly that you are saying that we won't have to wrap the parent widget's build method with the BlocProvider before using the bloc in a builder with this change? |
yes sir 👍 |
Can you be more specific please 🤗
In this way, how can I provide a bloc in scoped route? I don't like all above MaterialApp @felangel thanks |
f65a06d to
6821b59
Compare
I removed those deletions for now until there is a proper solution in place 👍 |
0f22dbc to
1c7ba5d
Compare
1c7ba5d to
e909e81
Compare
38bec3c to
7b76013
Compare
|
About I wonder could we make it shorter as well? Like this: |
@anticafe unfortunately I don't think so because you need to actually create the bloc and if it has dependencies you need to inject them. |
|
@felangel check my code it is not clean when I used a nested bloc builders |
7b76013 to
f84a696
Compare
|
@amreniouinnovent you can currently use |
|
@felangel Thank you |
|
@felangel I'm upgrading from 0.15.0 and there's a lot of new good things! 😃 I was thinking to follow a 2-steps process like:
I'm wondering: is Automatic Bloc Lookup "mandatory"? I have BlocBuilder<CounterBloc, int>(
bloc: blocObject,
builder: (context, state) { ... },
)where Shall I conclude that |
|
@algodave thanks for the positive feedback! Your 2 step approach makes perfect sense and the automatic bloc lookup is not mandatory. You should definitely be able to manually provide your own bloc instance. Are you able to share a link to a sample app which illustrates the problem? Thanks! |
|
@felangel Thank you for your prompt reply and the good news 😉 I'll provide a sample, but I'll be able to do that on Monday. |
|
Nice video for this release |
Status
READY
Breaking Changes
YES
Description
Automatic Bloc Lookup
Instead of having to manually do the bloc lookup for
BlocBuilderandBlocListenerwhenever the bloc is not specified, the default behavior will be to lookup the bloc viaBlocProviderautomatically.BlocBuilder Current Usage
BlocBuilder Updated Usage
BlocListener Current Usage
BlocListener Updated Usage
BlocProvider within the same build
It is now possible to provide and access a bloc within the same
buildTodos
Impact to Remaining Code Base
Breaking change which will be included in flutter_bloc v0.20.0