SafaehSnapSheet class

A non-modal bottom sheet that sits over live content, such as a map.

On a phone the sheet drags between snapFractions (fractions of the available height, ascending). Scrolling content inside it hands off to the drag at the top edge. The content behind the sheet is the host's child and is not rebuilt while the sheet moves.

At SafaehThemeData.tabletBreakpoint and wider the sheet becomes a fixed side panel of sidePanelWidth at the start edge (end edge in RTL is handled by Directionality).

Inheritance

Constructors

SafaehSnapSheet({Key? key, required Widget child, required Widget sheetBuilder(BuildContext context, ScrollController scrollController), List<double> snapFractions = const [0.18, 0.5, 0.92], int initialSnap = 1, SafaehSnapSheetController? controller, ValueChanged<int>? onSnapChanged, double sidePanelWidth = 380, bool showHandle = true, String? handleLabel, Color? backgroundColor, double? radius})
const

Properties

backgroundColor → Color?
final
child → Widget
The live content behind the sheet, for example a map and its chrome.
final
controller → SafaehSnapSheetController?
final
handleLabel → String?
Localized semantics label for the drag handle.
final
hashCode → int
The hash code for this object.
no setterinherited
initialSnap → int
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSnapChanged → ValueChanged<int>?
Called after a drag or SafaehSnapSheetController.snapTo settles.
final
radius → double?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sheetBuilder → Widget Function(BuildContext context, ScrollController scrollController)
Builds the sheet body. Pass scrollController to the primary scrollable so drag and scroll hand off. On a side panel it is a plain controller.
final
showHandle → bool
final
sidePanelWidth → double
final
snapFractions → List<double>
Ascending fractions of the height, each in (0, 1].
final

Methods

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