scroll_dismissible_page

CI pub package

A lightweight Flutter page wrapper with scroll-aware swipe-down-to-dismiss.

Wrap a full-screen route (gallery, detail sheet, media viewer) and let users drag down to close — without breaking nested ListView / PageView scrolling. Dismiss only engages when the child scroll position is at the top edge.

Demo

Features

  • Swipe down to dismiss a route
  • Scroll-aware: nested vertical scrollables keep working
  • Distance and velocity thresholds
  • Soft fade while dragging
  • Disable gestures with enabled: false
  • Optional popOnDismiss when you handle navigation yourself
  • Zero third-party dependencies beyond Flutter

Install

dependencies:
  scroll_dismissible_page: ^0.1.0
import 'package:scroll_dismissible_page/scroll_dismissible_page.dart';

Usage

Navigator.of(context).push(
  MaterialPageRoute<void>(
    builder: (_) => ScrollDismissiblePage(
      backgroundColor: Colors.black,
      onDismissed: () => debugPrint('dismissed'),
      child: Scaffold(
        backgroundColor: Colors.transparent,
        appBar: AppBar(
          backgroundColor: Colors.transparent,
          title: const Text('Look detail'),
        ),
        body: ListView.builder(
          itemCount: 20,
          itemBuilder: (context, index) => ListTile(
            title: Text('Item $index'),
          ),
        ),
      ),
    ),
  ),
);

Customization

Parameter Description
child Page content to drag
onDismissed Called when dismiss is committed
backgroundColor Color behind the translating child
dismissThreshold Drag distance (px) to dismiss by distance
minDragDistance Minimum drag before a fling can dismiss
minDismissVelocity Fling velocity (px/s) that can dismiss early
enabled Disable swipe dismiss when false
popOnDismiss Call Navigator.pop after dismiss (default true)

Manual navigation

ScrollDismissiblePage(
  popOnDismiss: false,
  onDismissed: () => Navigator.of(context).maybePop(),
  child: const YourPage(),
)

Example

See the example/ app for a home screen that opens a dismissible gallery-style route with a scrollable body.

License

MIT

Libraries

scroll_dismissible_page
A Flutter page wrapper with scroll-aware swipe-down-to-dismiss.