-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Custom transitions/animations #7
Comments
Hi, thanks for reminding me of this. I got to start the code, but ended up being interrupted with a giant project, and I forgot about it. I will include this in the new big update, along with bottomsheet and translucent snacks with blur, iOS notifications style. |
Thank you! I'll wait for the update to use it! |
Transitions added to navigatorRoutes |
Thank you for you efforts and being so fast to add the transitions, I think it improves so much the library! These transitions you added gives an easy way to have a great UX/UI! Also, just to point it out here for someone that maybe will be searching for more complex animations (as I do in some screens). I'm using Get.key.currentState.push() and passing a custom route based on PageRouteBuilder to do animations that aren't in the transitions enum and it's working perfect! I also want to know if this is the right way to do it and if is there any problem returning these custom PageRouteBuilder in the Router class for named routes (I'm not using it now but probably will use later) instead of returning GetRoute. Thank you again for this great library! |
Yes, you can use Get.key.currentState.push() as well you can use Get.key.currentContext when you need the context outside the widget tree. Using PageRouteBuilder can bring up the MaterialApp bug of route reconstruction that was fixed by this lib. To ensure that this does not happen, set opaque = false, but using it is much better than using MaterialPageRoute or CupertinoPageRoute, because these two wrappers are very poorly optimized. I created a pull to request in the Framework to fix these problems, but it takes a long time to get approved. For small applications this is ok, but large applications are not viable. I recorded this video to show the difference in RAM usage between standard navigation and GetRoute. I will think of a way to define custom animations with GetRoute to make it more secure in the future. https://www.youtube.com/watch?v=yVBqT6hg4VA&t=9s But yes, it is ok to use PageRouteBuilder instead of GetRoute, as long as you set opaque = false. |
Wow, thanks to point it out! I was noting rebuilds in pages that weren't supposed to be affected when I was navigating between some pages but in my searches this was considerated "normal". I did saw the improvement of the rebuilds when setting opaque to false, now there is just one page that gets rebuilt in one specific transition (that wasn't supposed to do it, but it's not affecting perfomance), but I'm not sure if it's because of the PageRouteBuilder or bad use of shared controllers of my application, I'll refactor the code later and this will be clear. I'm also glad that you are brazilian! I'm too! It's good to see the brazilian community doing an amazong work on flutter! |
hi @scostagabriel |
Hi @jemariads , unfortunately I think it's not possible to use custom animations routes with pushNamed, only with push. This is because pushNamed doesn't provide an easy way to do the leaving transition of the route because it doesn't pass the current widget to the PageRoute to apply transition. |
Hey @scostagabriel How did you implement Get.key.currentState.push()? I'm also using custom transitions based on PageRouteBuilder but my GetX controller isn't disposing unless I'm using Get.to() |
HI @Francis0118 , I'm not using GetX on my active projects but I was using just like I do now with If you can use a custom transition but the problem is that the controller isn't disposing I think it's better that you create a new issue to investigate this as this issue is closed. |
Ok thanks. What did you use to pop? Get.back() or Get.key.currentState.pop()? |
I don't remember anymore, but I think it was |
First I want to thank you for the effort to bring us this amazing library, it's really time saving!
I want to know if is it possible to add custom transitions/animations both to Get.to and Get.dialog. I saw some parameters in getroute.dart but I couldn't find a way to do it.
If it's not present, is it possible to add this feature? I think that this is the only thing that is preventing me to use it for all my navigations and dialogs as I have custom transitions almost everywhere.
The text was updated successfully, but these errors were encountered: