edge_swipe 0.0.1 copy "edge_swipe: ^0.0.1" to clipboard
edge_swipe: ^0.0.1 copied to clipboard

A Flutter package for detecting left-edge swipe gestures with a curved line animation and back button.

edge_swipe #

A Flutter package for detecting edge swipe gestures with a curved line animation and back button.

Features #

  • Detects horizontal swipes on the left edge of the screen.
  • Displays a curved line animation during swipe.
  • Shows an animated back button that responds to swipe progress.
  • Allows unhandled gestures to pass through to parent widgets.

Installation #

Add this to your pubspec.yaml:

dependencies:
  edge_swipe: ^0.0.1

Run:
flutter pub get

Usage
Import the package:
import 'package:edge_swipe/edge_swipe.dart';

Wrap your content with EdgeSwipe:
EdgeSwipe(
                        curvedLineColor:
                            Theme.of(context).brightness == Brightness.dark
                                ? Theme.of(context).colorScheme.surface
                                : Colors.white,
                        curvedLineShadowColor: Theme.of(context)
                            .colorScheme
                            .secondary
                            .withOpacity(.2),
                        onSwipeLeft: () {
                          Navigator.pop(context);
                        },
                        child: const Center(
                          child: Text(
                            'Swipe left to go back',
                            style: TextStyle(
                              fontSize: 24,
                            ),
                          ),
                        ),
                      ),

Parameters

child: The widget to display behind the swipe effect.
onSwipeLeft: Callback triggered when swipe threshold is reached.
onSwipeRight: Callback triggered when swipe threshold is reached.
curveHeightPercent: Height of the curved line (default: 30.0).
percentToInvoke: Minimum 0, maximum 1 The percentage of curve amount to invoke the swipe action. Default is 0.3, meaning the swipe action will be invoked when the curve amount reaches 30%.
curvedLineColor: Color for the curved line.
curvedLineShadowColor: Shadow color for the curved line.
edgeChildBuilder: A builder function to create a widget that appears at the edge during the swipe. The function receives the current context and a boolean indicating if the swipe action has been invoked.
Example
See the example directory for a complete sample app.```
4
likes
0
points
27
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for detecting left-edge swipe gestures with a curved line animation and back button.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on edge_swipe