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
Minor improvements with small breaking changes #2087
Conversation
@jonataslaw please review this, I would like these to get merged before the docs PR |
Wow, thanks for that. |
I just saw the Scope additions, and they are really nice, also what do you think about adding an Obx.context((context) {
//return widget
}) |
This is something I would like to discuss. The point is that not using context within builders is a Flutter anti-pattern, and I wanted to get rid of anti-patterns in version 5. However I know a lot of the community likes the convenience of using a context-free wrapper, and often they want to update a component that doesn't need to access MediaQuery, Theme, or anything the context is required. |
Using context, MixinBuilder totally loses its usefulness too and can be removed, with GetBuilder using Scope we have a single listener being delivered by the whole tree instead of several StatefulWidgets subscribing to a listener. This is a significant performance improvement and the best part is being able to subscribe listeners inside any widget that has context. We can listen for an update() inside an Obx, if it had context (the problem is that it doesn't pass this context by parameter). Maybe we'll also just use navigator 2 (this will require more care in it), and there are things you just can't do with it, like route response, which will break compatibility. We need migration guides from the old Get.back(result: 'bla') to navigator 2. There are so many things to discuss. This is the first big change. We have had virtually no break versions since version 1, the breaks were so subtle. In this version I think things are going to be a little heavier. |
@jonataslaw there is no need for breaking changes at all, look at this branch I made: you can introduce new api while maintaining backward compatibility with old api |
as for the navigation API, I suggest we leave it as is. |
@jonataslaw Great , i think if you can add get cli for replacing all previous obx with obx.context , you should definitely do it . It will be major breaking change as well as anti- Flutter problem will be solved |
I like the bindings changes, can you make it return an iterable instead of list ? |
We can. Is there any specific reason for this? |
I think the changes I made to the Bindings ended up conflicting. |
well, since users are required to override this method, it's good to always require the least restrictive type (a.k.a. |
I will solve it |
your changes are going to break the public API for the middleware though @jonataslaw |
Our next update will be a major change, so we can change the current api without fear |
Would it be possible to leave isDesktop/isTablet/isPhone as it used to be? |
but the old API would be inconsistent, I think it's better to make a breaking change now which will be better in the long run |
Actually on this code on a phone with the horizontal orientation, and isPhone == false. |
well, it makes sense, since the correct way to check is using checkpoints, not binary if |
I think we should keep both apis. As for the dependency manager, it sounds good to me, |
Sorry, I have timelines to comply, I will accept the PR, but make the required changes |
can you please publish it as 5.0.0-alpha1 ? |
Just to let you know. |
@jonataslaw why not leave the public API as Iterable and convert it to list internally? |
This also breaks GetPageRoute. It's not impossible to do, but we have a lot of changes to make. |
can I make a PR to rewrite the public API? |
This contains some minor improvements and a few breaking changes
GetPageRoute
as a parameter to thedependencies
method (see added PageBindings that references GetPageRoute in [dependencies] method #1722)pickPagesForRootNavigator
toGetDelegate
, will be explained in the documentation WIP nav2 documentation #2032ValueBuilder
throwing due to incorrect nullability handlingisPhoneOrLess
isPhoneOrWider
isPhone
falls back toisPhoneOrLess
(old behavior, non breaking)isSmallTabletOrLess
isSmallTabletOrWider
isSmallTablet
falls back toisSmallTabletOrLess
(BREAKING)isLargeTabletOrLess
isLargeTabletOrWider
isLargeTablet
falls back toisLargeTabletOrLess
(BREAKING)isDesktopOrLess
isDesktopOrWider
isDesktop
falls back toisDesktopOrLess
(BREAKING)width
not the shortest side, which is the consistent way to build the UIGetDelegate
api signature to returnFuture<void>
instead ofFuture<T>
, if the user wants to get a value from a route, they should either use services orGet.dialog
s, the old API was returning a value from a completer, and it wasn't consistent across browser refreshes, so it's for the best they get removed altogetherPre-launch Checklist
///
).