Search packages, repositories and app categories

cupertino_back_gesture cover
Package detailsv0.1.0

cupertino_back_gesture

A package to set custom width of iOS back swipe gesture area.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.8K
Likes
69
Pub points
150

Install package

flutter pub add cupertino_back_gesture

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The cupertino_back_gesture package allows developers to customize the width of the iOS-style back swipe gesture area in Flutter applications. This is particularly useful for fine-tuning the interactive edge for navigation, ensuring a more intuitive user experience on iOS platforms. The package extends Flutter's default CupertinoPageRoute behavior without requiring deep platform-specific modifications. It supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it versatile for cross-platform apps that prioritize consistent iOS navigation patterns.

Use cases

  • Customizing iOS back gesture area width
  • Improving navigation UX on iOS
  • Cross-platform iOS-style navigation
  • Fine-tuning swipe sensitivity
  • Enhancing gesture responsiveness
  • Tailoring gestures for specific UI layouts

Key features

  • Adjustable back swipe width
  • iOS-native gesture behavior
  • Cross-platform compatibility
  • Minimal setup required
  • No need for custom route implementations
  • Works with CupertinoPageRoute

Suitable for

  • Developers targeting iOS users
  • Apps with complex navigation flows
  • Teams seeking iOS consistency
  • Projects requiring gesture customization
  • Flutter apps with deep linking
  • UX-focused mobile development

Considerations

  • Limited to iOS-style back gestures
  • May require testing on multiple devices
  • Not needed for standard gesture behavior
  • Does not affect Android back behavior
  • Best used with Cupertino navigation
  • Potential conflicts with other gesture detectors

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

  • 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)
before after

Example app

Complete example can be found in example folder

Categories

Source repository

Projects using this package

No data available yet.