### Snapping - After Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of the new snapping configuration in v0.11.x. ```dart Sheet( snapGrid: SheetSnapGrid( snaps: [SheetOffset(0.7), SheetOffset(1)], ), // ... ) ``` -------------------------------- ### Snapping - Before Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of the old snapping configuration in v0.10.x. ```dart Sheet( minOffset: SheetOffset(0.7), physics: BouncingSheetPhysics( parent: SnappingSheetPhysics(), ), // ... ) ``` -------------------------------- ### Custom Fade-and-Slide Transition Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example implementation of a fade-and-slide transition to preserve v0.10.x behavior. ```dart // Example implementation of a fade-and-slide transition: Widget platformAdaptiveFadeAndSlideTransition( BuildContext context, Animation animation, Animation secondaryAnimation, Widget child, ) { final PageTransitionsTheme theme = Theme.of(context).pageTransitionsTheme; return FadeTransition( opacity: CurveTween(curve: Curves.easeInExpo).animate(animation), child: FadeTransition( opacity: Tween(begin: 1.0, end: 0.0) .chain(CurveTween(curve: Curves.easeOutExpo)) .animate(secondaryAnimation), child: theme.buildTransitions( ModalRoute.of(context) as PageRoute, context, animation, secondaryAnimation, child, ), ), ); } ``` -------------------------------- ### Physics and SnapGrid Separation - After Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of the new physics and snapping configuration in v0.11.x. ```dart Sheet( physics: BouncingSheetPhysics(), snapGrid: SheetSnapGrid( snaps: [SheetOffset(0.5), SheetOffset(1)], ), // ... ) ``` -------------------------------- ### Different Types of SnapGrid Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Examples of different SheetSnapGrid implementations in v0.11.x. ```dart // Single snap point (snaps to only one position) const SingleSnapGrid(snap: SheetOffset(1)) ``` ```dart // Multiple snap points const MultiSnapGrid( snaps: [SheetOffset(0.5), SheetOffset(1)], ) ``` ```dart // Continuous/Stepless snapping (with a minimum) const SteplessSnapGrid(minOffset: SheetOffset(0.5)) ``` -------------------------------- ### Physics and SnapGrid Separation - Before Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of the old physics and snapping configuration in v0.10.x. ```dart DraggableSheet( physics: BouncingSheetPhysics( parent: SnappingSheetPhysics( behavior: SnapToNearest( anchors: [ SheetAnchor.proportional(0.5), SheetAnchor.proportional(1), ], ), ), ), // ... ) ``` -------------------------------- ### Sheet Styling API - Before v0.11.x Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of sheet styling using Material/Card widgets in v0.10.x. ```dart Sheet( child: Card( margin: EdgeInsets.zero, clipBehavior: Clip.antiAlias, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(20), ), ), child: YourSheetContent(), ), ) ``` -------------------------------- ### StretchingSheetPhysics to BouncingSheetPhysics migration Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.8.x.md Example demonstrating the migration from StretchingSheetPhysics to BouncingSheetPhysics, including the change in controlling bouncing behavior. ```dart const physics = StretchingSheetPhysics( stretchingRange: Extent.proportional(0.1), ); ``` ```dart const physics = BouncingSheetPhysics( behavior: FixedBouncingBehavior(Extent.proportional(0.1)), ); ``` -------------------------------- ### Sheet Styling API - After v0.11.x Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of sheet styling using the new MaterialSheetDecoration in v0.11.x. ```dart Sheet( decoration: MaterialSheetDecoration( size: SheetSize.fit, // or SheetSize.sticky shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(20), ), ), ), child: YourSheetContent(), ) ``` -------------------------------- ### SheetContentScaffold - Before v0.11.x Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of SheetContentScaffold usage in v0.10.x. ```dart SheetContentScaffold( extendBody: true, extendBodyBehindAppBar: true, appBar: AppBar(), body: YourContent(), bottomNavigationBar: YourBottomBar(), ) ``` -------------------------------- ### Draggable Sheet Migration Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Compares the 'BEFORE' (v0.10.x) DraggableSheet usage with the 'AFTER' (v0.11.x) Sheet usage, highlighting changes in physics and snapping configuration. ```dart DraggableSheet( minPosition: const SheetAnchor.proportional(0.5), physics: const BouncingSheetPhysics( parent: SnappingSheetPhysics(), ), child: Material( // Sheet styling child: yourContent, ), ) ``` ```dart Sheet( // Physics and the snapping behavior configuration are now separated physics: const BouncingSheetPhysics(), snapGrid: const SheetSnapGrid( snaps: [SheetOffset(0.5), SheetOffset(1)], ), decoration: MaterialSheetDecoration( size: SheetSize.stretch, // Sheet styling goes here ), child: yourContent, ) ``` -------------------------------- ### Scrollable Sheet Migration Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Compares the 'BEFORE' (v0.10.x) ScrollableSheet usage with the 'AFTER' (v0.11.x) Sheet usage, showing the addition of scrollConfiguration and changes in decoration. ```dart ScrollableSheet( child: Material( borderRadius: BorderRadius.circular(16), clipBehavior: Clip.antiAlias, child: ListView(...), ), ) ``` ```dart Sheet( // Specify a SheetScrollConfiguration to make the sheet work with scrollables scrollConfiguration: const SheetScrollConfiguration(), decoration: MaterialSheetDecoration( size: SheetSize.stretch, borderRadius: BorderRadius.circular(16), clipBehavior: Clip.antiAlias, ), child: ListView(...), ) ``` -------------------------------- ### Sheet Styling API - Using SheetDecorationBuilder Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of advanced sheet styling using SheetDecorationBuilder in v0.11.x. ```dart Sheet( decoration: SheetDecorationBuilder( size: SheetSize.sticky, builder: (context, child) { return ClipRRect( borderRadius: BorderRadius.circular(16), child: ColoredBox( color: CupertinoColors.systemGroupedBackground, child: child, ), ); }, ), child: YourContent(), ) ``` -------------------------------- ### BouncingSheetPhysics Examples Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/configuration.md Examples of BouncingSheetPhysics with different configurations. ```dart // Playful, bouncy (default) BouncingSheetPhysics() // Very bouncy with large extent BouncingSheetPhysics(bounceExtent: 200, resistance: 4) // Subtle bounce with small extent BouncingSheetPhysics(bounceExtent: 50, resistance: 10) ``` -------------------------------- ### ClampingSheetPhysics Examples Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/configuration.md Examples of ClampingSheetPhysics with different spring configurations. ```dart // Default clamping ClampingSheetPhysics() // Stiffer spring (faster settling) ClampingSheetPhysics( spring: SpringDescription( mass: 0.5, stiffness: 200.0, damping: 20.0, ), ) // Softer spring (slower, smoother settling) ClampingSheetPhysics( spring: SpringDescription( mass: 1.0, stiffness: 50.0, damping: 10.0, ), ) ``` -------------------------------- ### Complete Example: Confirmation Modal Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/modal-sheets.md A full example demonstrating a confirmation modal sheet. ```dart Future showConfirmationSheet(BuildContext context) { return showModalSheet( context: context, builder: (context) => ConfirmationSheet(), ); } class ConfirmationSheet extends StatelessWidget { @override Widget build(BuildContext context) { return Sheet( decoration: MaterialSheetDecoration( size: SheetSize.fit, color: Colors.white, borderRadius: BorderRadius.vertical( top: Radius.circular(16), ), ), child: Padding( padding: EdgeInsets.all(24), child: Column( mainAxisSize: MainAxisSize.min, children: [ Text( 'Are you sure?', style: Theme.of(context).textTheme.titleLarge, ), SizedBox(height: 24), Row( children: [ Expanded( child: OutlinedButton( onPressed: () => Navigator.pop(context, false), child: Text('Cancel'), ), ), SizedBox(width: 16), Expanded( child: ElevatedButton( onPressed: () => Navigator.pop(context, true), child: Text('Confirm'), ), ), ], ), ], ), ), ); } } // Usage: final confirmed = await showConfirmationSheet(context); if (confirmed ?? false) { // Handle confirmation } ``` -------------------------------- ### v0.10.x NavigationSheet API Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Shows the old API for NavigationSheet, which required manual setup of styling and transitions. ```dart // NavigationSheet required transitionObserver and manual styling NavigationSheet( transitionObserver: transitionObserver, child: Material( borderRadius: BorderRadius.circular(16), clipBehavior: Clip.antiAlias, color: Theme.of(context).colorScheme.surface, child: navigator, // Containing Draggable/ScrollableNavigationSheetPage ), ); // Page used built-in transition DraggableNavigationSheetPage( key: state.pageKey, child: const YourPageContent(), ); // Scrollable page required specific class and position configuration ScrollableNavigationSheetPage( initialPosition: SheetAnchor.proportional(0.7), minPosition: SheetAnchor.proportional(0.7), physics: BouncingSheetPhysics( parent: SnappingSheetPhysics(), ), child: const YourScrollablePageContent(), ) ``` -------------------------------- ### SheetContentScaffold - After v0.11.x Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example of SheetContentScaffold usage in v0.11.x with updated properties. ```dart SheetContentScaffold( extendBodyBehindBottomBar: true, extendBodyBehindTopBar: true, topBar: AppBar(), body: YourContent(), bottomBar: YourBottomBar(), ) ``` -------------------------------- ### SheetViewport for Regular Sheets Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Example demonstrating the usage of SheetViewport as a required component for non-modal sheets in v0.11.x. ```dart SheetViewport( child: Sheet( // ... sheet configuration ), ) ``` -------------------------------- ### BottomBarVisibility Changes - Before v0.10.x Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Examples of controlling bottom bar visibility using standalone widgets in v0.10.x. ```dart SheetContentScaffold( // ... bottomBar: StickyBottomBarVisibility( child: YourBottomBarWidget(), ), ) SheetContentScaffold( // ... bottomBar: ConditionalStickyBottomBarVisibility( getIsVisible: (metrics) { // Condition based on old metrics (e.g., pixels) return metrics.pixels >= metrics.contentSize * 0.5; }, child: YourBottomBarWidget(), ), ) ``` -------------------------------- ### Complete Sheet Configuration Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/configuration.md A comprehensive example demonstrating various configuration options for the Sheet widget, including initial state, physics, snapping, controller, scrolling, dragging, styling, and content. ```dart Sheet( // Initial state initialOffset: SheetOffset(0.4), // Physics and snapping physics: BouncingSheetPhysics( bounceExtent: 120, resistance: 6, ), snapGrid: SheetSnapGrid( snaps: [ SheetOffset(0.3), SheetOffset(0.7), SheetOffset(1.0), ], ), // Control and observation controller: _sheetController, // Content scrolling scrollConfiguration: SheetScrollConfiguration(), // Dragging dragConfiguration: SheetDragConfiguration(), // Styling decoration: MaterialSheetDecoration( size: SheetSize.fit, borderRadius: BorderRadius.vertical( top: Radius.circular(20), ), elevation: 8, color: Colors.white, ), padding: EdgeInsets.symmetric(horizontal: 16), // Content child: SheetContentScaffold( extendBodyBehindBottomBar: true, bottomBarVisibility: BottomBarVisibility.conditional( isVisible: (metrics) => metrics.offset > metrics.minOffset + 100, duration: Duration(milliseconds: 200), ), topBar: AppBar(title: Text('Sheet')), body: ListView(children: [/* ... */]), bottomBar: BottomAppBar(child: /* ... */), ), ) ``` -------------------------------- ### Listener Behavior Examples Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-controller.md Examples demonstrating immediate and deferred listener behavior. ```dart // For animations (immediate) controller.addListener( () => animation.forward(), fireImmediately: true, ); // For widget rebuilds (deferred) controller.addListener(() { setState(() { // Update state }); }); ``` -------------------------------- ### bottomBar Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/content-scaffold.md Example of using the bottomBar property. ```dart SheetContentScaffold( body: YourContent(), bottomBar: BottomAppBar( child: Row( children: [ TextButton(child: Text('Cancel'), onPressed: () {}), Spacer(), ElevatedButton(child: Text('Save'), onPressed: () {}), ], ), ), ) ``` -------------------------------- ### topBar Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/content-scaffold.md Example of using the topBar property. ```dart SheetContentScaffold( topBar: AppBar( title: Text('Sheet Title'), ), body: YourContent(), ) ``` -------------------------------- ### BottomBarVisibility Changes - After v0.11.x Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.11.x.md Examples of controlling bottom bar visibility using static constructors in v0.11.x. ```dart SheetContentScaffold( // ... // Use the bottomBarVisibility property bottomBarVisibility: const BottomBarVisibility.always(), bottomBar: YourBottomBarWidget(), ) SheetContentScaffold( // ... bottomBarVisibility: BottomBarVisibility.conditional( isVisible: (metrics) { // Condition based on new metrics (e.g., offset) return metrics.offset >= const SheetOffset(0.5).resolve(metrics); }, ), bottomBar: YourBottomBarWidget(), ) ``` -------------------------------- ### resizeToAvoidBottomInset removed Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.4.x.md Example showing the removal of resizeToAvoidBottomInset and its replacement with the resizeBehavior property. ```dart SheetContentScaffold( resizeToAvoidBottomInset: true, body: SizedBox.expand(), ); ``` ```dart SheetContentScaffold( resizeBehavior: const ResizeScaffoldBehavior.avoidBottomInset( // Make the bottom bar visible even when the keyboard is open. maintainBottomBar: true, ), body: SizedBox.expand(), ); ``` -------------------------------- ### Good Example: Pull-to-Refresh Support Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-template.md An example of a well-written release note entry for a new feature, focusing on user benefits and providing clear usage information. ```markdown ### Pull-to-Refresh Support in Sheets *Reported in [#264](https://github.com/fujidaiti/smooth_sheets/issues/264), fixed in [#402](https://github.com/fujidaiti/smooth_sheets/pull/402)* We've added support for pull-to-refresh functionality and overscroll effects within sheets through the new `delegateUnhandledOverscrollToChild` flag in `SheetScrollConfiguration`. When enabled, this flag allows overscroll deltas that aren't handled by the sheet's physics to be passed to child scrollable widgets, enabling `RefreshIndicator` and `BouncingScrollPhysics` effects to work seamlessly within sheet content. This feature maintains backward compatibility and requires explicit opt-in, ensuring no impact on existing code. ``` -------------------------------- ### Example Usage of New Feature Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-template.md A placeholder for a Dart code example demonstrating how to use a new feature described in the release notes. ```dart // Code example showing how to use the feature ``` -------------------------------- ### Handling swipe-to-dismiss with PopScope Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.6.x.md Example of using PopScope to handle swipe-to-dismiss and other pop actions in v0.6.0. ```dart PopScope( canPop: false, onPopInvoked: (didPop) { // We can use this callback to handle not only swipe-to-dismiss gestures, // but also system back gestures and modal barrier taps, etc. }, child: DraggableSheet(...), ); ``` -------------------------------- ### requiredMinExtentForStickyBottomBar removed Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.4.x.md Example showing the removal of requiredMinExtentForStickyBottomBar and its replacement with BottomBarVisibility widgets. ```dart SheetContentScaffold( requiredMinExtentForStickyBottomBar: const Extent.proportional(0.5), body: SizedBox.expand(), bottomBar: BottomBar(), ); ``` ```dart SheetContentScaffold( body: SizedBox.expand(), // This widget keeps the child BottomBar always visible // regardless of the sheet position as long as the `getIsVisible` // callback returns true. bottomBar: ConditionalStickyBottomBarVisibility( getIsVisible: (metrics) { final halfSize = Extent.proportional(0.5).resolve(metrics.contentDimensions); return metrics.pixels > halfSize; }, child: BottomBar(), ), ); ``` -------------------------------- ### NaturalBottomBarVisibility Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/content-scaffold.md Example of using NaturalBottomBarVisibility. ```dart SheetContentScaffold( bottomBarVisibility: BottomBarVisibility.natural( ignoreBottomInset: true, // Bar moves up with keyboard ), body: YourContent(), ) ``` -------------------------------- ### Complete Example: Todo List Sheet Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/content-scaffold.md A complete example of a Todo List Sheet using Sheet and SheetContentScaffold, including AppBar and BottomAppBar. ```dart class TodoListSheet extends StatelessWidget { final List todos = [ 'Buy groceries', 'Write documentation', 'Review pull requests', ]; @override Widget build(BuildContext context) { return Sheet( decoration: MaterialSheetDecoration( size: SheetSize.stretch, borderRadius: BorderRadius.vertical( top: Radius.circular(20), ), ), child: SheetContentScaffold( extendBodyBehindBottomBar: true, topBar: AppBar( title: Text('My Todos'), elevation: 0, ), body: ListView.builder( itemCount: todos.length, itemBuilder: (context, index) { return CheckboxListTile( title: Text(todos[index]), value: false, onChanged: (value) {}, ); }, ), bottomBar: BottomAppBar( child: Row( children: [ Expanded( child: OutlinedButton( onPressed: () => Navigator.pop(context), child: Text('Cancel'), ), ), SizedBox(width: 8), Expanded( child: ElevatedButton( onPressed: () => Navigator.pop(context), child: Text('Done'), ), ), ], ), ), ), ); } } ``` -------------------------------- ### SheetController Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-controller.md Example of creating a SheetController instance. ```dart final controller = SheetController(); ``` -------------------------------- ### initialOffset Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Example demonstrating how to set the initial offset for the Sheet widget. ```dart Sheet( initialOffset: SheetOffset(0.4), // Start collapsed to 40% child: YourContent(), ) ``` -------------------------------- ### Example: SheetOffset.proportionalToViewport Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-offset.md Example of creating a SheetOffset.proportionalToViewport. ```dart // Position at half the viewport height final offset = SheetOffset.proportionalToViewport(0.5); ``` -------------------------------- ### Example: ProportionalToViewportSheetOffset Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-offset.md Example of creating a ProportionalToViewportSheetOffset. ```dart final offset = ProportionalToViewportSheetOffset(0.5); // Position at half the screen height ``` -------------------------------- ### Example: resolve Instance Method Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-offset.md Example of using the resolve method. ```dart final controller = SheetController(); final metrics = controller.metrics; if (metrics != null) { final pixelOffset = SheetOffset(0.5).resolve(metrics); print('Offset in pixels: $pixelOffset'); } ``` -------------------------------- ### snapGrid Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Example demonstrating custom snap positions for the Sheet widget. ```dart Sheet( snapGrid: SheetSnapGrid( snaps: [ SheetOffset(0.3), SheetOffset(0.7), SheetOffset(1.0), ], ), child: YourContent(), ) ``` -------------------------------- ### Example: SheetOffset.absolute Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-offset.md Examples of creating an AbsoluteSheetOffset. ```dart // Fixed 200px from top final offset = SheetOffset.absolute(200); // 100px from keyboard (when it appears) final offset = SheetOffset.absolute(100, relativeToBaseline: true); ``` -------------------------------- ### AlwaysVisibleBottomBarVisibility Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/content-scaffold.md Example of using AlwaysVisibleBottomBarVisibility. ```dart SheetContentScaffold( bottomBarVisibility: BottomBarVisibility.always(), body: YourContent(), bottomBar: BottomAppBar(...), ) ``` -------------------------------- ### ControlledBottomBarVisibility Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/content-scaffold.md Example of using ControlledBottomBarVisibility. ```dart final animationController = AnimationController(vsync: this); SheetContentScaffold( extendBodyBehindBottomBar: true, bottomBarVisibility: BottomBarVisibility.controlled( animation: animationController, ), body: YourContent(), bottomBar: BottomAppBar(...), ) ``` -------------------------------- ### Bad Example: Internal Refactoring Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-template.md An example of a poorly written release note entry that includes implementation details and technical jargon instead of user benefits. ```markdown ### Internal Refactoring of Sheet Physics *Fixed in [#XXX](https://github.com/fujidaiti/smooth_sheets/pull/XXX)* Previously, the overscroll handling was broken because the SheetViewport was consuming all scroll deltas without delegating them to children. We refactored the _ScrollAwareSheetActivityMixin to add a new boolean flag that controls whether unhandled overscroll gets passed through to child widgets. ``` -------------------------------- ### transitionDuration Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/modal-sheets.md Example of setting the transitionDuration for a ModalSheetPage. ```dart ModalSheetPage( transitionDuration: Duration(milliseconds: 500), child: YourSheet(), ) ``` -------------------------------- ### extendBodyBehindBottomBar Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/content-scaffold.md Example of using extendBodyBehindBottomBar. ```dart SheetContentScaffold( extendBodyBehindBottomBar: true, body: YourContent(), bottomBar: BottomNavigationBar( items: [...], ), ) ``` -------------------------------- ### Complete iOS-Style Sheet Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/cupertino-sheets.md A comprehensive example demonstrating how to create a nested iOS-style sheet with a custom top bar and list content. ```dart class IOSStyleSheet extends StatefulWidget { @override State createState() => _IOSStyleSheetState(); } class _IOSStyleSheetState extends State { @override Widget build(BuildContext context) { return CupertinoModalSheetRoute( builder: (context) => CupertinoSheet(), swipeDismissible: true, transitionDuration: Duration(milliseconds: 500), ); } } class CupertinoSheet extends StatelessWidget { @override Widget build(BuildContext context) { return Sheet( decoration: BoxSheetDecoration( size: SheetSize.fit, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.vertical( top: Radius.circular(20), ), ), ), child: SheetContentScaffold( topBar: Padding( padding: EdgeInsets.all(16), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ TextButton( onPressed: () => Navigator.pop(context), child: Text('Cancel'), ), Text('Settings', style: TextStyle(fontWeight: FontWeight.bold)), SizedBox(width: 60), // Spacer for balance ], ), ), body: ListView( children: [ SwitchListTile( title: Text('Dark Mode'), value: false, onChanged: (value) {}, ), SwitchListTile( title: Text('Notifications'), value: true, onChanged: (value) {}, ), ListTile( title: Text('About'), trailing: Icon(Icons.chevron_right), onTap: () { Navigator.push( context, CupertinoModalSheetRoute( builder: (context) => AboutSheet(), ), ); }, ), ], ), ), ); } } class AboutSheet extends StatelessWidget { @override Widget build(BuildContext context) { return Sheet( child: SheetContentScaffold( topBar: Padding( padding: EdgeInsets.all(16), child: Row( children: [ TextButton( onPressed: () => Navigator.pop(context), child: Text('Back'), ), Spacer(), Text('About', style: TextStyle(fontWeight: FontWeight.bold)), Spacer(), SizedBox(width: 60), ], ), ), body: Padding( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('App Name', style: Theme.of(context).textTheme.titleLarge), SizedBox(height: 8), Text('Version 1.0.0', style: Theme.of(context).textTheme.bodySmall), SizedBox(height: 24), Text('Description', style: Theme.of(context).textTheme.titleMedium), SizedBox(height: 8), Text('This is an example of nested iOS-style sheets...'), ], ), ), ), ); } } ``` -------------------------------- ### SteplessSnapGrid Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-snap-grid.md Example usage of SteplessSnapGrid. ```dart // Allow free dragging from 0% to 100% of content height Sheet( snapGrid: SheetSnapGrid.stepless( minOffset: SheetOffset(0.2), maxOffset: SheetOffset(1.0), ), child: YourContent(), ) ``` -------------------------------- ### SingleSnapGrid Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-snap-grid.md Example usage of SingleSnapGrid. ```dart Sheet( snapGrid: SheetSnapGrid.single(snap: SheetOffset(1.0)), child: YourContent(), ) // Using default snap grid (same as above) Sheet( snapGrid: const SheetSnapGrid.single(snap: SheetOffset(1.0)), child: YourContent(), ) ``` -------------------------------- ### Example: SheetOffset (default) Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-offset.md Example of creating a default SheetOffset. ```dart // Show 60% of sheet content final offset = SheetOffset(0.6); ``` -------------------------------- ### controller Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Example of using a SheetController to programmatically control the sheet. ```dart final controller = SheetController(); Sheet( controller: controller, child: YourContent(), ) // Later: animate sheet await controller.animateTo(SheetOffset(0.5)); ``` -------------------------------- ### ClampingSheetPhysics Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-physics.md Example of using ClampingSheetPhysics. ```dart Sheet( physics: ClampingSheetPhysics(), child: YourContent(), ) ``` -------------------------------- ### dragConfiguration Default Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Example showing the default drag configuration for the Sheet widget. ```dart Sheet( dragConfiguration: SheetDragConfiguration(), child: YourContent(), ) ``` -------------------------------- ### extendBodyBehindTopBar Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/content-scaffold.md Example of using extendBodyBehindTopBar. ```dart SheetContentScaffold( extendBodyBehindTopBar: true, topBar: AppBar( backgroundColor: Colors.transparent, ), body: YourContent(), ) ``` -------------------------------- ### Example: RelativeSheetOffset Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-offset.md Example of creating a RelativeSheetOffset. ```dart final offset = RelativeSheetOffset(0.75); // 75% of content height ``` -------------------------------- ### Complete Example: Airbnb-style Map Reveal Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/offset-driven-animation.md This example demonstrates how to use `SheetOffsetDrivenAnimation` to create an Airbnb-style map reveal effect. As the sheet is pulled down, the opacity of the map increases, revealing it behind the sheet. ```dart class AirbnbStyleSheet extends StatefulWidget { @override State createState() => _AirbnbStyleSheetState(); } class _AirbnbStyleSheetState extends State { final _sheetController = SheetController(); @override void dispose() { _sheetController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { final mapRevealAnimation = SheetOffsetDrivenAnimation( controller: _sheetController, initialValue: 0.0, startOffset: SheetOffset(0.3), endOffset: SheetOffset(0.0), ); return Stack( children: [ // Map in background Opacity( opacity: mapRevealAnimation.value, child: GoogleMap( initialCameraPosition: CameraPosition( target: LatLng(37.7749, -122.4194), zoom: 11, ), ), ), // Sheet overlays the map Sheet( controller: _sheetController, initialOffset: SheetOffset(0.3), snapGrid: SheetSnapGrid( snaps: [ SheetOffset(0.3), SheetOffset(1.0), ], ), child: SheetContentScaffold( body: ListView( children: [ ListTile(title: Text('House 1')), ListTile(title: Text('House 2')), ], ), ), ), ], ); } } ``` -------------------------------- ### SheetKeyboardDismissible Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/keyboard-dismiss-behavior.md Example usage of SheetKeyboardDismissible. ```dart SheetKeyboardDismissible( dismissBehavior: SheetKeyboardDismissBehavior.onDragDown(), child: Sheet( child: YourContent(), ), ) ``` -------------------------------- ### barrierColor Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/modal-sheets.md Example of setting the barrierColor for a ModalSheetPage. ```dart ModalSheetPage( barrierColor: Colors.black.withOpacity(0.4), child: YourSheet(), ) ``` -------------------------------- ### Complete Example: Sheet with Drag Feedback Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/notifications.md A complete example demonstrating how to use NotificationListener to provide drag feedback (velocity display, haptic feedback) for a Sheet. ```dart class SheetWithDragFeedback extends StatefulWidget { @override State createState() => _SheetWithDragFeedbackState(); } class _SheetWithDragFeedbackState extends State { double _currentVelocity = 0; bool _isDragging = false; @override Widget build(BuildContext context) { return NotificationListener( onNotification: (notification) { setState(() { switch (notification) { case SheetDragStartNotification(): _isDragging = true; case SheetDragUpdateNotification(): final details = notification.dragDetails; _currentVelocity = details.velocity.distance; case SheetDragEndNotification(): _isDragging = false; final velocity = notification.dragDetails.velocity.distance; print('Final velocity: $velocity px/s'); case SheetDragCancelNotification(): _isDragging = false; case SheetOverflowNotification(): if (notification.overflow > 30) { HapticFeedback.mediumImpact(); } case SheetUpdateNotification(): // Non-drag update break; } }); return false; }, child: Column( children: [ if (_isDragging) Text('Dragging at ${_currentVelocity.toStringAsFixed(1)} px/s'), Expanded( child: Sheet( physics: BouncingSheetPhysics(), child: YourContent(), ), ), ], ), ); } } ``` -------------------------------- ### scrollConfiguration With Scrolling Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Example of enabling scroll integration for the Sheet widget with scrollable content. ```dart Sheet( scrollConfiguration: SheetScrollConfiguration(), child: ListView(...), ) ``` -------------------------------- ### Removal of SheetDismissible - After Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.6.x.md Example of using swipeDismissible: true on ModalSheetRoute in v0.6.0. ```dart ModalSheetRoute( swipeDismissible: true, builder: (conatext) { return DraggableSheet(...); }, ); ``` -------------------------------- ### Removal of SheetDismissible - Before Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.6.x.md Example of using SheetDismissible in v0.5.x to enable swipe-to-dismiss. ```dart ModalSheetRoute( builder: (conatext) { return SheetDismissible( child: DraggableSheet(...), ); }, ); ``` -------------------------------- ### Complete Example: Todo Form Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/keyboard-dismiss-behavior.md A full example of a Todo Form implemented within a SheetKeyboardDismissible widget, utilizing content scroll awareness for keyboard dismissal. ```dart class TodoFormSheet extends StatefulWidget { @override State createState() => _TodoFormSheetState(); } class _TodoFormSheetState extends State { final _titleController = TextEditingController(); final _descriptionController = TextEditingController(); @override void dispose() { _titleController.dispose(); _descriptionController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return SheetKeyboardDismissible( dismissBehavior: SheetKeyboardDismissBehavior.onDragDown( isContentScrollAware: true, ), child: Sheet( child: SingleChildScrollView( child: Padding( padding: EdgeInsets.all(16), child: Column( children: [ TextField( controller: _titleController, decoration: InputDecoration(labelText: 'Todo Title'), ), SizedBox(height: 16), TextField( controller: _descriptionController, decoration: InputDecoration(labelText: 'Description'), maxLines: 5, ), SizedBox(height: 24), ElevatedButton( onPressed: _saveTodo, child: Text('Save'), ), ], ), ), ), ), ); } void _saveTodo() { // Save logic here } } ``` -------------------------------- ### Media Content Example (Video) Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-template.md An HTML snippet for embedding a video with specified width and controls, as recommended for media content in release notes. ```html ``` -------------------------------- ### Slide with Sheet Motion Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/offset-driven-animation.md Example of using SheetOffsetDrivenAnimation to slide content up as the sheet expands. ```dart // Slide content up as sheet expands Transform.translate( offset: Offset(0, 100 * (1 - animation.value)), child: YourWidget(), ) ``` -------------------------------- ### Scale Animation Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/offset-driven-animation.md Example of using SheetOffsetDrivenAnimation to scale a widget based on sheet motion. ```dart Transform.scale( scale: 0.8 + (0.2 * animation.value), // Scale from 0.8 to 1.0 child: YourWidget(), ) ``` -------------------------------- ### Smooth Dragging with Bounds Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-snap-grid.md Example using SheetSnapGrid.stepless to allow smooth dragging within defined minimum and maximum offset bounds. ```dart Sheet( snapGrid: SheetSnapGrid.stepless( minOffset: SheetOffset(0.2), maxOffset: SheetOffset(0.9), ), child: YourContent(), ) ``` -------------------------------- ### Example: Basic Non-scrollable Sheet Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md A basic example of a Sheet widget with non-scrollable content. ```dart Sheet( child: Padding( padding: EdgeInsets.all(16), child: Column( children: [ Text('Sheet Title'), // ... more content ], ), ), ) ``` -------------------------------- ### Example: Scrollable Sheet Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md An example of a Sheet widget configured for scrollable content using ListView. ```dart Sheet( scrollConfiguration: SheetScrollConfiguration(), child: ListView( children: [ ListTile(title: Text('Item 1')), ListTile(title: Text('Item 2')), // ... more items ], ), ) ``` -------------------------------- ### Example: AbsoluteSheetOffset (relativeToBaseline: true) Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-offset.md Example of creating an AbsoluteSheetOffset with relativeToBaseline set to true. ```dart final offset = AbsoluteSheetOffset(50, relativeToBaseline: true); // 50px above keyboard ``` -------------------------------- ### Dismissal Offset Usage Examples Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-0.15.0.md Examples demonstrating how to use `SwipeDismissSensitivity.dismissalOffset` with different threshold definitions. ```dart const SwipeDismissSensitivity(dismissalOffset: SheetOffset(0.4)); ``` ```dart const SwipeDismissSensitivity(dismissalOffset: SheetOffset.absolute(200)); ``` ```dart const SwipeDismissSensitivity(dismissalOffset: SheetOffset.proportionalToViewport(0.5)); ``` ```dart const SwipeDismissSensitivity(dismissalOffset: CustomThreshold()); ``` ```dart class CustomThreshold implements SheetOffset { const CustomThreshold(); @override double resolve(ViewportLayout metrics) { return max(metrics.contentSize.height * 0.5, 80); } } ``` -------------------------------- ### Bottom Sheet with Peek and Expand Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-snap-grid.md Example of a bottom sheet configuration with a peek height and a fully expanded state using SheetSnapGrid. ```dart Sheet( initialOffset: SheetOffset(0.3), snapGrid: SheetSnapGrid( snaps: [ SheetOffset(0.3), SheetOffset(1.0), ], ), child: YourContent(), ) ``` -------------------------------- ### PagedSheetRouteTheme Usage Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/paged-sheet.md Example of how to wrap a PagedSheet with PagedSheetRouteTheme to provide custom theme defaults. ```dart PagedSheetRouteTheme( data: PagedSheetRouteThemeData( transitionDuration: Duration(milliseconds: 500), snapGrid: SheetSnapGrid(snaps: [SheetOffset(0.5), SheetOffset(1.0)]), ), child: PagedSheet( navigator: navigator, ), ) ``` -------------------------------- ### Declarative Usage with go_router Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/modal-sheets.md Example of integrating modal sheets with the go_router package. ```dart GoRouter( routes: [ ShellRoute( builder: (context, state, child) => Scaffold( body: child, ), routes: [ GoRoute( path: '/', builder: (context, state) => HomeScreen(), routes: [ SheetRoute( path: 'sheet', pageBuilder: (context, state) => ModalSheetPage( child: YourSheet(), ), ), ], ), ], ), ], ) // Trigger from home screen: GoRouter.of(context).push('/sheet'); ``` -------------------------------- ### Example: Basic Sheet with Initial Offset Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-offset.md Demonstrates how to set an initial offset for a Sheet. ```dart Sheet( initialOffset: SheetOffset(0.5), child: YourContent(), ) ``` -------------------------------- ### BouncingSheetPhysics Example - More Bouncy Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-physics.md More bouncy with larger extent. ```dart // More bouncy with larger extent Sheet( physics: BouncingSheetPhysics( bounceExtent: 200, resistance: 4, ), child: YourContent(), ) ``` -------------------------------- ### SnapToNearest can no longer be const Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.3.x.md Example showing the change in `SnapToNearest` from being a `const` to not being a `const`, and the use of `SnapToNearestEdge`. ```dart physics: const StretchingSheetPhysics( parent: SnappingSheetPhysics( snappingBehavior: SnapToNearest( snapTo: [ Extent.proportional(0.2), Extent.proportional(0.5), Extent.proportional(1), ], ), ), ), ``` ```dart physics: StretchingSheetPhysics( // Can no longer be a const parent: SnappingSheetPhysics( snappingBehavior: SnapToNearest( snapTo: [ const Extent.proportional(0.2), const Extent.proportional(0.5), const Extent.proportional(1), ], ), ), ), ``` -------------------------------- ### Migration for both shrinkChildToAvoidDynamicOverlap and shrinkChildToAvoidStaticOverlap: true Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-0.17.0/release-note-0.17.0.md Example demonstrating how to migrate when both 'shrinkChildToAvoidDynamicOverlap: true' and 'shrinkChildToAvoidStaticOverlap: true' were used, combining both padding strategies. ```dart Sheet( shrinkChildToAvoidDynamicOverlap: true, shrinkChildToAvoidStaticOverlap: true, child: ..., ); ``` ```dart Sheet( padding: EdgeInsets.only( bottom: math.max( MediaQuery.viewInsetsOf(context).bottom, MediaQuery.viewPaddingOf(context).bottom, ), ), child: ..., ); ``` -------------------------------- ### Usage with Sheet Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-controller.md Example of integrating SheetController with a Sheet widget. ```dart class MySheetWidget extends StatefulWidget { @override State createState() => _MySheetWidgetState(); } class _MySheetWidgetState extends State { final controller = SheetController(); @override void dispose() { controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Column( children: [ ElevatedButton( onPressed: () async { await controller.animateTo(SheetOffset(1.0)); }, child: Text('Expand Sheet'), ), Expanded( child: Sheet( controller: controller, child: YourContent(), ), ), ], ); } } ``` -------------------------------- ### enablePullToDismiss removed from modal sheets Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/migration-guide-0.3.x.md Example demonstrating the removal of `enablePullToDismiss` from modal sheets and its replacement with `SheetDismissible`. ```dart ModalSheetRoute( enablePullToDismiss: true, (context) => MySheet(...), ); ``` ```dart ModalSheetRoute( (context) => SheetDismissible( onDismiss: () {...}, // Dismissing event can be handled here. child: MySheet(...), ), ); ``` -------------------------------- ### Usage with DefaultSheetController Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet-controller.md Example demonstrating automatic controller management using DefaultSheetController. ```dart DefaultSheetController( child: Builder( builder: (context) { return Column( children: [ ElevatedButton( onPressed: () async { final controller = DefaultSheetController.of(context); await controller.animateTo(SheetOffset(1.0)); }, child: Text('Expand'), ), Expanded( child: Sheet( child: YourContent(), ), ), ], ); }, ), ) ``` -------------------------------- ### DragDownSheetKeyboardDismissBehavior Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/keyboard-dismiss-behavior.md Example usage of DragDownSheetKeyboardDismissBehavior. ```dart SheetKeyboardDismissible( dismissBehavior: SheetKeyboardDismissBehavior.onDragDown(), child: Sheet(child: YourForm()), ) ``` -------------------------------- ### Example: Keyboard Handling Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Shows how to handle keyboard interactions within a Sheet using SheetKeyboardDismissible. ```dart SheetKeyboardDismissible( dismissBehavior: SheetKeyboardDismissBehavior.onDragDown(), child: Sheet( child: YourFormContent(), ), ) ``` -------------------------------- ### DragSheetKeyboardDismissBehavior Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/keyboard-dismiss-behavior.md Example usage of DragSheetKeyboardDismissBehavior. ```dart SheetKeyboardDismissible( dismissBehavior: SheetKeyboardDismissBehavior.onDrag(), child: Sheet(child: YourForm()), ) ``` -------------------------------- ### Migration for shrinkChildToAvoidStaticOverlap: true Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-0.17.0/release-note-0.17.0.md Example demonstrating how to migrate from 'shrinkChildToAvoidStaticOverlap: true' to using the 'padding' property to avoid screen notches. ```dart Sheet( shrinkChildToAvoidStaticOverlap: true, child: ..., ); ``` ```dart Sheet( padding: EdgeInsets.only( bottom: MediaQuery.viewPaddingOf(context).bottom, ), child: ..., ); ``` -------------------------------- ### Migration for shrinkChildToAvoidDynamicOverlap: true Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-0.17.0/release-note-0.17.0.md Example demonstrating how to migrate from 'shrinkChildToAvoidDynamicOverlap: true' to using the 'padding' property to avoid the keyboard. ```dart Sheet( shrinkChildToAvoidDynamicOverlap: true, child: ..., ); ``` ```dart Sheet( padding: EdgeInsets.only( bottom: MediaQuery.viewInsetsOf(context).bottom, ), child: ..., ); ``` -------------------------------- ### Example: Sheet with Controller Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Illustrates how to control a Sheet's state programmatically using a SheetController. ```dart class MySheet extends StatefulWidget { @override State createState() => _MySheetState(); } class _MySheetState extends State { final _controller = SheetController(); @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Column( children: [ ElevatedButton( onPressed: () async { await _controller.animateTo(SheetOffset(1.0)); }, child: Text('Expand'), ), Expanded( child: Sheet( controller: _controller, child: YourContent(), ), ), ], ); } } ``` -------------------------------- ### Example: Sheet with Multiple Snap Positions Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Demonstrates how to configure a Sheet with multiple snap positions for different expansion states. ```dart Sheet( initialOffset: SheetOffset(0.3), snapGrid: SheetSnapGrid( snaps: [ SheetOffset(0.3), // Peek position SheetOffset(0.6), // Half expanded SheetOffset(1.0), // Fully expanded ], ), child: YourContent(), ) ``` -------------------------------- ### Example: Material-styled Sheet Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/sheet.md Shows how to apply Material Design styling to a Sheet using MaterialSheetDecoration. ```dart Sheet( decoration: MaterialSheetDecoration( size: SheetSize.fit, color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20), ), elevation: 16, ), child: YourContent(), ) ``` -------------------------------- ### Table Format for Media Comparisons Source: https://github.com/fujidaiti/smooth_sheets/blob/main/notes/release-note-template.md A markdown table structure for comparing 'Before' and 'After' states, using HTML video tags for visual demonstrations. ```markdown | Before | After | |------|------| | | | ``` -------------------------------- ### swipeDismissSensitivity Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/modal-sheets.md Example of customizing swipeDismissSensitivity for a ModalSheetPage. ```dart ModalSheetPage( swipeDismissible: true, swipeDismissSensitivity: SwipeDismissSensitivity( factor: 0.8, // Less sensitive ), child: YourSheet(), ) ``` -------------------------------- ### SheetDragCancelNotification Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/notifications.md Example of using NotificationListener to handle SheetDragCancelNotification. ```dart NotificationListener( onNotification: (notification) { print('Drag cancelled'); return false; }, child: Sheet(child: YourContent()), ) ``` -------------------------------- ### SheetDragEndNotification Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/notifications.md Example of using NotificationListener to listen for SheetDragEndNotification. ```dart NotificationListener( onNotification: (notification) { final velocity = notification.dragDetails.velocity.distance; print('Drag ended with velocity: ${velocity.toStringAsFixed(2)} px/s'); return false; }, child: Sheet(child: YourContent()), ) ``` -------------------------------- ### SheetDragUpdateNotification Example Source: https://github.com/fujidaiti/smooth_sheets/blob/main/_autodocs/api-reference/notifications.md Example of using NotificationListener to listen for SheetDragUpdateNotification. ```dart NotificationListener( onNotification: (notification) { final delta = notification.dragDetails.deltaY; print('Dragged by: $delta pixels'); return false; }, child: Sheet(child: YourContent()), ) ```