PiN73 / cupertino_back_gesture

Flutter package to set custom width of iOS back swipe gesture area
BSD 3-Clause "New" or "Revised" License
30 stars 17 forks source link
dart flutter flutter-package ios

cupertino_back_gesture

pub package

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

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

Screenshots

Areas where back swipe gesture can be started are shaded with hatching

Default Flutter BackGestureWidth.fraction(1 / 2)
before after

Example app

Complete example can be found in example folder