SlidingSheet class

A widget that can be dragged and scrolled in a single gesture and snapped to a list of extents.

The builder parameter must not be null.

Inheritance

Constructors

SlidingSheet({Key? key, SheetBuilder? builder, CustomSheetBuilder? customBuilder, SheetBuilder? headerBuilder, SheetBuilder? footerBuilder, SnapSpec snapSpec = const SnapSpec(), Duration duration = const Duration(milliseconds: 1000), SlidingSheetStateController? slidingSheetStateController, Color? color, Color? backdropColor, Color? shadowColor = Colors.black54, double elevation = 0.0, EdgeInsets? padding, bool avoidStatusBar = false, EdgeInsets? margin, EdgeInsets? marginWhenExpanded, Border? border, double cornerRadius = 0.0, double? cornerRadiusWhenExpanded = 0.0, bool closeOnBackdropTap = false, SheetListener? listener, SheetController? controller, ScrollSpec scrollSpec = const ScrollSpec(overscroll: false), double maxWidth = double.infinity, double? minHeight, bool closeSheetOnBackButtonPressed = false, bool isBackdropInteractable = false, Widget? body, ParallaxSpec? parallaxSpec, double axisAlignment = 0.0, bool extendBody = false, double liftOnScrollHeaderElevation = 0.0, double liftOnScrollFooterElevation = 0.0, bool isDismissable = true, OnDismissPreventedCallback? onDismissPrevented, SystemUiOverlayStyle? systemUiOverlayStyle, SystemUiOverlayStyle? systemUiOverlayStyleWhenExpanded})
Creates a sheet than can be dragged and scrolled in a single gesture to be placed inside you widget tree.
SlidingSheet.dialog({Key? key, SheetListener? listener, SheetController? controller, SheetBuilder? builder, CustomSheetBuilder? customBuilder, SheetBuilder? headerBuilder, SheetBuilder? footerBuilder, SnapSpec snapSpec = const SnapSpec(), Duration duration = const Duration(milliseconds: 800), Color? color, Color backdropColor = Colors.black54, Color? shadowColor, double elevation = 0.0, EdgeInsets? padding, bool avoidStatusBar = false, EdgeInsets? margin, EdgeInsets? marginWhenExpanded, Border? border, double cornerRadius = 0.0, double? cornerRadiusWhenExpanded = 0.0, bool closeOnBackdropTap = true, ScrollSpec scrollSpec = const ScrollSpec(overscroll: false), double maxWidth = double.infinity, double? minHeight, bool closeSheetOnBackButtonPressed = true, bool isBackdropInteractable = true, Widget? body, ParallaxSpec? parallaxSpec, double axisAlignment = 0.0, bool extendBody = false, double liftOnScrollHeaderElevation = 0.0, double liftOnScrollFooterElevation = 0.0, bool isDismissable = true, OnDismissPreventedCallback? onDismissPrevented, SystemUiOverlayStyle? systemUiOverlayStyle, SystemUiOverlayStyle? systemUiOverlayStyleWhenExpanded})
Creates a bottom sheet dialog than can be dragged and scrolled in a single gesture.
factory

Properties

avoidStatusBar bool
If true, adds the top padding returned by MediaQuery.of(context).viewPadding.top to the padding when taking up the full screen.
final
axisAlignment double
{@template perceive_slidable.axisAlignment} How to align the sheet on the horizontal axis when the available width is bigger than the maxWidth of the sheet.
final
backdropColor Color?
The color of the shadow that is displayed behind the sheet.
final
body Widget?
A widget that is placed behind the sheet.
final
border Border?
A border that will be drawn around the sheet.
final
builder SheetBuilder?
The builder for the main content of the sheet that will be scrolled if the content is bigger than the height that the sheet can expand to.
final
closeOnBackdropTap bool
If true, will collapse the sheet when the sheets backdrop was tapped.
final
closeSheetOnBackButtonPressed bool
If true, closes the sheet when it is open and prevents the route from being popped.
final
color Color?
The background color of the sheet.
final
controller SheetController?
A controller to control the state of the sheet.
final
cornerRadius double
The radius of the top corners of this sheet.
final
cornerRadiusWhenExpanded double?
The radius of the top corners of this sheet when expanded to fullscreen.
final
customBuilder CustomSheetBuilder?
Allows you to supply your own custom sroll view. Useful for infinite lists that cannot be shrinkWrapped like long lists.
final
duration Duration
The base animation duration for the sheet. Swipes and flings may have a different duration.
final
elevation double
The elevation of the sheet.
final
extendBody bool
{@template perceive_slidable.extendBody} Whether to extend the scrollable body of the sheet under header and/or footer. {@endTemplate}
final
footerBuilder SheetBuilder?
The builder for a footer that will be displayed at the bottom of the sheet that wont be scrolled.
final
hashCode int
The hash code for this object.
no setterinherited
headerBuilder SheetBuilder?
The builder for a header that will be displayed at the top of the sheet that wont be scrolled.
final
isBackdropInteractable bool
If true, the backDrop will also be interactable so any gesture that is applied to the backDrop will be delegated to the sheet itself.
final
isDismissable bool
If false, the SlidingSheetDialog will not be dismissable.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
liftOnScrollFooterElevation double
{@template perceive_slidable.liftOnScrollFooterElevation} The elevation of the footer when there content scrolls under it. {@endTemplate}
final
liftOnScrollHeaderElevation double
{@template perceive_slidable.liftOnScrollHeaderElevation} The elevation of the header when the content scrolls under it. {@endTemplate}
final
listener SheetListener?
A callback that will be invoked when the sheet gets dragged or scrolled with current state information.
final
margin EdgeInsets?
The amount of empty space surrounding the sheet.
final
marginWhenExpanded EdgeInsets?
The amount of empty space sourrounding the sheet when expanded.
final
maxWidth double
The minimum height of the sheet of the child returned by the builder.
final
minHeight double?
The minimum height of the sheet of the child returned by the builder.
final
onDismissPrevented OnDismissPreventedCallback?
A callback that gets invoked when a user tried to dismiss the dialog while isDimissable is set to true.
final
padding EdgeInsets?
The amount to inset the children of the sheet.
final
parallaxSpec ParallaxSpec?
A ParallaxSpec to create a parallax effect.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollSpec ScrollSpec
The ScrollSpec of the containing ScrollView.
final
shadowColor Color?
The color of the drop shadow of the sheet when elevation is > 0.
final
slidingSheetStateController SlidingSheetStateController?
final
snapSpec SnapSpec
The SnapSpec that defines how the sheet should snap or if it should at all.
final
systemUiOverlayStyle SystemUiOverlayStyle?
final
systemUiOverlayStyleWhenExpanded SystemUiOverlayStyle?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _SlidingSheetState
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
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}) 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