snapping_sheet 2.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 91

Snapping sheet #

A package that provides a highly customizable sheet widget that snaps to different vertical positions

Using a ListView in
Example using only
Using a ListView in

You can run the examples by cloning the following repository and run the app from the example folder.

Quick start #

Begin by following the install instruction.

You can add the snapping sheet to you app by adding the following code

    import 'package:flutter/material.dart';
    import 'package:snapping_sheet/snapping_sheet.dart';

    class SnapSheetExample extends StatelessWidget {
        Widget build(BuildContext context) {
            return Scaffold(
            body: SnappingSheet(
                    sheetBelow: SnappingSheetContent(
                        child: Container(
                    grabbing: Container(

Snap positions #

To change the snap positions for the sheet, change the snapPositions parameter witch takes in a list of SnapPosition.

        snapPositions: [
                positionPixel: 25.0, 
                snappingCurve: Curves.elasticOut, 
                snappingDuration: Duration(milliseconds: 750)
                positionFactor: 0.5, 
                snappingCurve: Curves.ease, 
                snappingDuration: Duration(milliseconds: 500)

Sheet content #

childThe widget inside the sheet.
marginThe margin for the sheet, can be negative
draggableIf the sheet should listen for drag events.
heightBehaviorHow the sheet height should behave when the size is changing

Other options #

childThe widget behind the sheet.
sheetBelowThe widget that is the remaining space between the bottom to the bottom of the grabbing widget.
sheetAboveThe widget that is the remaining space between the top to the top of the grabbing widget
grabbingThe widget fixed between the sheetBelow and sheetAbove.
grabbingHeightThe height of the grabbing widget.
snapPositionsThe different snap positions for the sheet
initSnapPositionThe init snap position, do not need to exist in the snapPositions list
snappingSheetControllerControl the sheet and get current snap position
onMoveCallback when the sheet is moving.
onSnapBeginCallback when a snap begins, happens when the user stops dragging the sheet.
onSnapEndCallback when a snap is completed.
lockOverflowDragPrevents the grabbing sheet to be dragged above the highest snapPosition or below the lowest snapPosition.

[2.0.0] - 07/05/2020 #

  • Breaking change: The sheetBelow and sheetAbove parameters now takes in a [snappingSheetContent] widget instead of any widget. To fix, just wrap your current widget with a [snappingSheetContent] widget.
  • Breaking change Changed so that sheetAboveMargin and sheetBelowMargin must specified in the[snappingSheetContent] widget.
  • Breaking change Changed so that sheetBelowDraggable and sheetAboveDraggable must specified in the[snappingSheetContent] widget.
  • Add the option to specify a heigh behavior when the size of the sheet is changing.

[1.1.2] - 04/03/2020 #

  • Fix error when sheet dragged after last or first [snappingPosition]. Thank you N1ght-Fury
  • Remove required syntax for [sheetBlow] parameter. Thank you Nico04

[1.1.1] - 12/11/2019 #

  • Fix a dragging bug where the grabbing widget is stuck when lockOverflowDrag was set to true

[1.1.0] - 29/10/2019 #

  • Added the option to make sheetBelow and sheetAbove widget draggable.
  • Added the option to lock overflow drag.
  • Added new example of using a top sheet.
  • Fix minor bugs with the snapping system.

[1.0.0] - 18/10/2019 #

  • Breaking changes, renamed parameters such as

    • sheet -> sheetBelow
    • remaining -> sheetAbove
    • grabing -> grabbing
    • grabingHeight -> grabbingHeight
    • remainingMargin -> sheetAboveMargin
    • snapSheetController -> snappingSheetController
  • The option to add negative and positive margin to the sheetBelow widget

  • The sheetBelow and sheetAbove widgets are now optional

[0.1.0] - 07/10/2019 #

  • Improve the snap system for the sheet. Now the sheet only snaps to above snap positions if dragging upwards and snap positions below if dragging downwards
  • Made the background widget (child) optional

[0.0.2] - 04/10/2019 #

  • Updated the pubspec description

[0.0.1] - 04/10/2019 #

  • The initial release


import 'package:example/placeholder_example.dart';
import 'package:example/listview_example.dart';
import 'package:example/topsheet_example.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
      routes: {
        '/ListViewExample': (context) => ListViewSnapSheetExample(),
        '/PlaceholderExample': (context) => PlaceholderSnapSheetExample(),
        '/TopSnapSheetExample': (context) => TopSnapSheetExample(),
      home: Scaffold(
        body: Builder(
          builder: (context) {
            return Padding(
              padding: EdgeInsets.all(25.0),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: <Widget>[
                    child: Text('Listview example'),
                    onPressed: () {
                    child: Text('Placeholder example'),
                    onPressed: () {
                    child: Text('Top sheet example'),
                    onPressed: () {

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  snapping_sheet: ^2.0.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:snapping_sheet/snapping_sheet.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.7
  • Flutter: 1.12.13+hotfix.9


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies