v0.13.0
๐ New Features
Modal Sheet Utility Functions - #370
Added utility functions to simplify displaying modal sheets.
New Functions:
- showModalSheet: Uses the standard ModalSheetRoute
- showCupertinoModalSheet: Uses CupertinoModalSheetRoute for iOS/macOS
- showAdaptiveModalSheet: Automatically selects the appropriate modal based on the platform
Usage:
// Automatic platform-adaptive selection
showAdaptiveModalSheet(
context: context,
// No SheetViewport is required here
builder: (context) => Sheet(
child: Container(height: 300),
),
);
// Standard modal
showModalSheet(
context: context,
builder: (context) => Sheet(...),
);
SheetScrollHandlingBehavior - #284
SheetScrollHandlingBehavior has been added to provide precise control over scroll gestures within scrollable widgets inside a sheet.
Usage:
Sheet(
scrollConfiguration: SheetScrollConfiguration(
scrollHandlingBehavior: SheetScrollHandlingBehavior.onlyFromTop,
),
child: ListView(...),
)
Available options:
always: The sheet always takes precedence over scrollable widgets for gesture handling, allowing it to move upward/downward in response to overscroll gestures. This option maintains the existing sheet behavior (used by default).onlyFromTop: The sheet behaves the same asalwaysmode when scrolling starts from the top position (ScrollPosition.pixels == 0.0). Otherwise, the scrollable widget handles the gesture exclusively, preventing the sheet from moving upward/downward in response to overscroll and enabling the scrollable widget to perform overscroll-driven behaviors such as the bouncing animation byBouncingScrollPhysics. This option was introduced to match native sheet behavior on iOS and Android platforms.
| .always | .onlyFromTop |
|------|------|
|
Full Changelog: https://github.com/fujidaiti/smooth_sheets/compare/v0.12.0...v0.13.0