Bottom Sheets

Loading preview

Starting the Flutter app

Simple, form, draggable, and nested scrolling variants

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

How it works

Three private helpers wrap showModalBottomSheet. _showFormSheet sets isScrollControlled and pads by viewInsets.bottom so fields clear the keyboard. _showDraggableSheet passes the DraggableScrollableSheet controller to its ListView, letting scroll and resize cooperate, with expand: false so it sizes inside the modal. The form’s TextFields have no controllers, so Submit only closes the sheet.

Adapting it

  • Add controllers in _showFormSheet, and return values through Navigator.pop(ctx, data).
  • Tune initialChildSize, minChildSize and maxChildSize for your content.
  • Pass showDragHandle: true to showModalBottomSheet in place of the hand-drawn handle.