ShadSheet class

A customizable sheet component that slides in from the edges of the screen.

It can be configured to slide from the top, bottom, left, or right, and supports draggable dismissal, custom styling, and actions.

Inheritance
Available extensions

Constructors

ShadSheet({Key? key, Widget? title, Widget? description, Widget? child, List<Widget> actions = const [], BoxConstraints? constraints, bool? expandCrossSide, Widget? closeIcon, IconData? closeIconData, ShadPosition? closeIconPosition, BorderRadius? radius, Color? backgroundColor, bool? expandActionsWhenTiny, EdgeInsetsGeometry? padding, double? gap, Axis? actionsAxis, MainAxisSize? actionsMainAxisSize, MainAxisAlignment? actionsMainAxisAlignment, VerticalDirection? actionsVerticalDirection, BoxBorder? border, List<BoxShadow>? shadows, bool? removeBorderRadiusWhenTiny, TextStyle? titleStyle, TextStyle? descriptionStyle, TextAlign? titleTextAlign, TextAlign? descriptionTextAlign, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool? scrollable, EdgeInsetsGeometry? scrollPadding, bool? draggable, VoidCallback? onClosing, SheetDragStartHandler? onDragStart, SheetDragEndHandler? onDragEnd, AnimationController? animationController, bool isScrollControlled = false, double? minFlingVelocity, double? closeProgressThreshold, Duration enterDuration = const Duration(milliseconds: 250), Duration exitDuration = const Duration(milliseconds: 200), double? disabledScrollControlMaxRatio, bool? useSafeArea, bool? titlePinned, bool? descriptionPinned, bool? actionsPinned, bool? expandable, double? initialSize, double? minSize, double? maxSize, bool? snap, List<double>? snapSizes, Duration? snapAnimationDuration, Curve? snapAnimationCurve, double? snapFlingVelocity, Widget? dragHandle, ShadSheetDragHandleBuilder? dragHandleBuilder, bool? showDragHandle, double? dragHandleExtent, ValueChanged<double>? onSizeChanged, ShadSheetController? controller})
A customizable sheet component that slides in from the edges of the screen.
const

Properties

actions List<Widget>
List of action widgets, typically buttons, displayed at the bottom or side of the sheet.
final
actionsAxis Axis?
Axis for arranging actions.
final
actionsMainAxisAlignment MainAxisAlignment?
Main axis alignment for actions.
final
actionsMainAxisSize MainAxisSize?
Main axis size for actions.
final
actionsPinned bool?
Whether the actions are pinned when scrolling and scrollable is true.
final
actionsVerticalDirection VerticalDirection?
Vertical direction for actions.
final
animationController AnimationController?
The animation controller that controls the sheet's entrance and exit animations.
final
backgroundColor Color?
Background color of the sheet.
final
border BoxBorder?
Border of the sheet.
final
child Widget?
The main content of the sheet.
final
closeIcon Widget?
Custom close icon widget.
final
closeIconData IconData?
Icon data for the default close icon.
final
closeIconPosition ShadPosition?
Position of the close icon.
final
closeProgressThreshold double?
The threshold for determining whether the sheet is closing.
final
constraints BoxConstraints?
Constraints for the sheet's size.
final
controller ShadSheetController?
Controller for programmatic size control. A private one is created automatically if not provided.
final
crossAxisAlignment CrossAxisAlignment?
Cross axis alignment for the sheet's content.
final
description Widget?
The description widget, providing more context under the title.
final
descriptionPinned bool?
Whether the description is pinned when scrolling and scrollable is true.
final
descriptionStyle TextStyle?
Style for the description text.
final
descriptionTextAlign TextAlign?
Text alignment for the description.
final
disabledScrollControlMaxRatio double?
The maximum ratio of the sheet's height when is not scroll controlled. Defaults to 9/16. Has no effect when draggable is false.
final
draggable bool?
Whether the sheet is draggable, allowing dismissal by dragging. Defaults to false.
final
dragHandle Widget?
Custom widget to use as the drag handle. When null, a default pill is shown (only when expandable is true and showDragHandle is true).
final
dragHandleBuilder ShadSheetDragHandleBuilder?
Side-aware builder for the drag handle. Takes precedence over dragHandle when non-null. Return the fully-rendered handle widget, including any padding or orientation logic your design needs — the sheet wraps whatever you return in the resize gesture detector.
final
dragHandleExtent double?
Extra draggable extent along the sheet's drag axis that overlays the sheet-adjacent edge of the body, in logical pixels.
final
enterDuration Duration
The duration of the sheet's entrance animation.
final
exitDuration Duration
The duration of the sheet's exit animation.
final
expandable bool?
Whether the sheet is expandable/resizable by dragging the handle. When true, a drag handle is shown and the sheet can be resized. Defaults to false.
final
expandActionsWhenTiny bool?
Whether to expand actions to full width when the screen is tiny.
final
expandCrossSide bool?
Whether to expand the sheet to the full width/height of the screen along the cross axis.
final
gap double?
Vertical gap between title, description, child, and actions.
final
hashCode int
The hash code for this object.
no setterinherited
initialSize double?
The initial size of the sheet as a fraction of screen height (vertical sides) or screen width (horizontal sides). Defaults to 0.5.
final
isScrollControlled bool
Whether the sheet is scroll controlled, allowing it to expand to full screen if content is taller. Defaults to false.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainAxisAlignment MainAxisAlignment?
Main axis alignment for the sheet's content.
final
maxSize double?
The maximum size the sheet can be dragged to. Defaults to 1.0.
final
minFlingVelocity double?
The minimum velocity to initiate a fling.
final
minSize double?
The minimum size the sheet can be dragged to. Defaults to 0.25.
final
onClosing VoidCallback?
Called when the sheet begins to close.
final
onDragEnd SheetDragEndHandler?
Called when the user stops dragging the sheet, if draggable is true.
final
onDragStart SheetDragStartHandler?
Called when the user begins dragging the sheet vertically, if draggable is true.
final
onSizeChanged ValueChanged<double>?
Called whenever the sheet size changes.
final
padding EdgeInsetsGeometry?
Padding around the content of the sheet.
final
radius BorderRadius?
Border radius of the sheet.
final
removeBorderRadiusWhenTiny bool?
Whether to remove border radius when the screen is tiny.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollable bool?
Whether the sheet's content is scrollable.
final
scrollPadding EdgeInsetsGeometry?
Padding for scrollable content.
final
shadows List<BoxShadow>?
List of shadows for the sheet.
final
showDragHandle bool?
Whether to show the drag handle. Defaults to true when expandable is true.
final
snap bool?
Whether the sheet snaps to stops after a drag. Defaults to false.
final
snapAnimationCurve Curve?
Curve of the snap animation. Defaults to Curves.easeInOut.
final
snapAnimationDuration Duration?
Duration of the snap animation. Defaults to 250ms.
final
snapFlingVelocity double?
Minimum velocity (px/s) in the resize axis to treat a drag release as a fling. Flings always target maxSize or minSize, ignoring snapSizes, so reaching the full screen requires maxSize to be 1.0. Applies even when snap is false.
final
snapSizes List<double>?
The size stops the sheet snaps to. Defaults to minSize, initialSize, maxSize when null.
final
title Widget?
The title widget of the sheet, typically displayed at the top.
final
titlePinned bool?
Whether the title is pinned when scrolling and scrollable is true.
final
titleStyle TextStyle?
Style for the title text.
final
titleTextAlign TextAlign?
Text alignment for the title.
final
useSafeArea bool?
Whether to wrap the dialog in a SafeArea widget to avoid system UI intrusions.
final

Methods

animate({Key? key, List<Effect>? effects, AnimateCallback? onInit, AnimateCallback? onPlay, AnimateCallback? onComplete, bool? autoPlay, Duration? delay, AnimationController? controller, Adapter? adapter, double? target, double? value}) Animate

Available on Widget, provided by the AnimateWidgetExtensions extension

Wraps the target Widget in an Animate instance, and returns the instance for chaining calls. Ex. myWidget.animate() is equivalent to Animate(child: myWidget).
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ShadSheet>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
positionedWith(ShadPosition position) Widget

Available on Widget, provided by the PositionedExt extension

toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

defaultAnimationCurve → const Cubic
Default easing for the open/close transitions of sheets shown via showShadSheet. M3 emphasizedDecelerate token — recommended by the Material 3 motion spec for sheets and dialogs entering view.
defaultEnterDuration → const Duration
Default open-transition duration for sheets shown via showShadSheet. Matches Material's BottomSheet enter timing. Override per call via animateIn, or globally via ShadSheetTheme.animateIn.
defaultExitDuration → const Duration
Default close-transition duration for sheets shown via showShadSheet. Matches Material's BottomSheet exit timing. Override per call via animateOut, or globally via ShadSheetTheme.animateOut.