Reputation: 2419
right now the back button in ios is by swiping from left to right I want to change it to right to left. how can I do that?
Upvotes: 1
Views: 769
Reputation: 1
Check this package: https://pub.dev/packages/swipe_effect
SwipeEffect(
direction: TextDirection.rtl,
color: Colors.green.withAlpha(70),
verticalTolerance: 1.0,
startDeltaPx: 30,
callbackDeltaRatio: 0.25,
callback: () {
// Navigator.pop(context);
},
child: ...,
);
Upvotes: 0
Reputation: 2419
the other answer will work but it is hard to make it work and if you don't know swift it would be really tough.
the easier way to do this is to change its locale back to English (consider that your app language is rtl like Farsi or Arabic)
MaterialApp(
debugShowCheckedModeBanner: false,
supportedLocales: [
Locale("en", "US"),
],
locale: Locale("en", "US"),
then change your page Directionality to rtl using Directionality
widget.
like this
Directionality(
textDirection: TextDirection.rtl,
child: Scaffold(
this will fix it
Upvotes: 0
Reputation: 303
I am guessing you want to create a right to left(RTL) application for example for arabic. Flutter supports the switch to RTL. Refer to the following:
right-to-left (RTL) in flutter
iOS back gesture for RTL Languages
Upvotes: 1