cupertino_back_gesture
a flutter package to set custom width of ios back swipe gesture area.
usage
to use this package, add cupertino_back_gesture
as a dependency in your pubspec.yaml file.
example
to change width of area where the user can start back swipe for the whole app
- wrap your
materialapp
withbackgesturewidththeme
with desiredbackgesturewidth
- set ios builder of
pagetransitionstheme
tocupertinopagetransitionsbuildercustombackgesturewidth
import 'package:cupertino_back_gesture/cupertino_back_gesture.dart';
backgesturewidththeme(
backgesturewidth: backgesturewidth.fraction(1 / 2),
child: materialapp(
theme: themedata(
pagetransitionstheme: pagetransitionstheme(
builders: {
targetplatform.android: fadeupwardspagetransitionsbuilder(),
targetplatform.ios: cupertinopagetransitionsbuildercustombackgesturewidth(),
},
),
),
home: mainpage(),
),
)
possible variants for backgesturewidth
are
backgesturewidth.fixed(w)
wherew
is width in logical pixelsbackgesturewidth.fraction(f)
wheref
is fraction of screen width from 0.0 to 1.0
screenshots
areas where back swipe gesture can be started are shaded with hatching
default flutter | backgesturewidth.fraction(1 / 2) |
---|---|
example app
complete example can be found in example folder
Comments are closed.