Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

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 with backgesturewidththeme with desired backgesturewidth
  • set ios builder of pagetransitionstheme to cupertinopagetransitionsbuildercustombackgesturewidth
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) where w is width in logical pixels
  • backgesturewidth.fraction(f) where f 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)
cupertino_back_gesturev cupertino_back_gesturevv

example app

complete example can be found in example folder


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.