Add fully customisable top sheets to your flutter apps, anchored at the top and controllable via gestures or controller.
You need something else ? Feel free to create issues, contribute to this project or to ask for new features on GitHub !
- Fully customizable top sheets for any use case.
- Smooth animations for open, close, and drag interactions.
To get started, add the package to your pubspec.yaml file:
flutter pub add persistent_top_sheet
Then, import the package into your Dart file:
import 'package:persistent_top_sheet/persistent_top_sheet.dart';
First create the client with optional parameters
// if you want to use the controller, you can use open(), close() or toggle()
// otherwise you can drag the handle by default
final controller = PersistentTopSheetController();
PersistentTopSheet(
maxHeight: 500,
minHeight: 50,
controller: controller,
childBuilder: (currentHeight) => SheetBody(currentHeight: currentHeight),
handleBuilder: (currentHeight) => const DragHandle(),
onStateChanged: (state) => debugPrint('isOpen: $state'),
);
There is a ready-to-use example in the /example
folder.
I created this package for my own needs. Happy to share !
Don't hesitate to ask for new features or to contribute on GitHub !
If you'd like to support this project, consider contributing here. Thank you! :)