flutter_page_transition icon indicating copy to clipboard operation
flutter_page_transition copied to clipboard

iOS swipe-to-go-back

Open carlleeswanson opened this issue 2 years ago • 9 comments

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?

carlleeswanson avatar Jun 19 '22 03:06 carlleeswanson

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

kalismeras61 avatar Jun 20 '22 08:06 kalismeras61

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 avatar Jun 20 '22 22:06 carlleeswanson

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

carlleeswanson avatar Jun 20 '22 22:06 carlleeswanson

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 avatar Jun 21 '22 06:06 kalismeras61

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

kalismeras61 avatar Jun 21 '22 07:06 kalismeras61

@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.

carlleeswanson avatar Jun 21 '22 15:06 carlleeswanson

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.

rajeshbdabhi avatar Jun 23 '22 06:06 rajeshbdabhi

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

JeffyLo94 avatar Aug 08 '22 18:08 JeffyLo94

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

M-Yahia2011 avatar Feb 10 '24 14:02 M-Yahia2011