kalismeras61 / flutter_page_transition

This is Flutter Page Transition Package
BSD 2-Clause "Simplified" License
475 stars 57 forks source link

iOS swipe-to-go-back #69

Open carlleeswanson opened 2 years ago

carlleeswanson commented 2 years ago

Issue #64 and Issue #44 have been closed as "wontfix", with the stated reason being that the problem is within flutter (https://github.com/flutter/flutter/issues/47441).

However, the flutter issue actually does describe two different workarounds. It seems that one of these could be applied to this package to give it the requested functionality. Any chance of that happening?

kalismeras61 commented 2 years ago

I have added new feature for that. Please check it. Don't forget IOS swipe back can use only rightToLeft and with Fade animation.

carlleeswanson commented 2 years ago

Thank you for adding that @kalismeras61 !!

I tested with v2.0.8 and swipe-back works as described with the rightToLeft and fade animations. :)

But there appears to be a slight additional problem with this new feature... When isIos=true, the fade animation doesn't do a fade. Instead it does a rightToLeft.

Should I open a new issue for that, or will you look at it under this one?

carlleeswanson commented 2 years ago

Is it possible to make this also work with PageTransitionType.scale?

kalismeras61 commented 2 years ago

Hi @carlleeswanson , i have tested with Fade animation and working fine. Increase duration and you will see the animation

Navigator.push( context, PageTransition( type: PageTransitionType.fade, child: SecondPage(), isIos: true, ), );

kalismeras61 commented 2 years ago

@carlleeswanson i have added scale transition but, i think it is not working right way. Please test it.

carlleeswanson commented 2 years ago

@kalismeras61 I tested PageTransitionType.scale in 2.0.9 with isIos=true. It works, but not in the way I would expect. It has the same issue as fade.

When isIos=false, fade and scale transitions occur directly into the currently displayed pane. When isIos=true, fade and scale transitions cause a visible right-to-left transition of a new pane (same as you get when configured for right-to-left). The fade/scale occur into this new pane.

So while the fade and scale transitions work (i.e. they function and don't break anything), they behave oddly. I would expect them to occur "in place" without seeing the underlying right-to-left transition.

If possible, I would prefer to not see the right-to-left transition that occurs "underneath". If that's not possible, the new isIos feature is still useful, but the transitions are much less visually appealing than when isIos=false.

rajeshbdabhi commented 2 years ago

I have used isIos=true with rightToLeft animation and it is working fine but not working when I add WillPopScope it not calling onWillPop method.

JeffyLo94 commented 2 years ago

I have used isIos=true with rightToLeft animation and it is working fine but not working when I add WillPopScope it not calling onWillPop method.

I think this an actively debated flutter issue: Read more here https://github.com/flutter/flutter/issues/14203

M-Yahia2011 commented 7 months ago

is there any possibility to have the iOS swipe back with leftToRight?