OverBottomSheet class
A widget that displays an always-visible, draggable bottom sheet.
Unlike the standard BottomSheet, this widget is always visible and can be dragged between multiple snap points. It supports nested scrolling within the sheet content.
Size values use auto-detection:
- Values > 1.0 are treated as fixed pixels
- Values ≤ 1.0 are treated as ratios of the parent size
{@tool snippet}
OverBottomSheet(
controller: controller,
snapPoints: const [0.0, 0.5, 1.0],
maxHeight: 0.8, // 80% of parent
minHeight: 100, // 100 pixels
showDragHandle: true,
content: ListView.builder(...),
child: const Center(child: Text('Background')),
)
{@end-tool}
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OverBottomSheet
Constructors
-
OverBottomSheet({Key? key, OverBottomSheetController? controller, required Widget child, required double maxHeight, required double minHeight, double? width, Widget? header, RatioWidgetBuilder? headerBuilder, Widget? content, RatioWidgetBuilder? contentBuilder, Color? backgroundColor, double? elevation, Color? shadowColor, Color? surfaceTintColor, ShapeBorder? shape, Clip? clipBehavior, bool? showDragHandle, Color? dragHandleColor, Size? dragHandleSize, double velocityThreshold = 300.0, List<
double> snapPoints = const [0.0, 1.0], bool handleNestedScroll = false, VoidCallback? onDragStart, void onDragEnd(double targetRatio)?, void onSnapComplete(double targetRatio)?}) -
Creates an always-visible bottom sheet.
const
Properties
- backgroundColor → Color?
-
Background color of the bottom sheet.
final
- child → Widget
-
The widget displayed behind the bottom sheet.
final
- clipBehavior → Clip?
-
Clip behavior for the sheet content.
final
- content → Widget?
-
Static content widget displayed in the sheet body.
final
- contentBuilder → RatioWidgetBuilder?
-
Builder for the content widget that receives the current ratio.
final
- controller → OverBottomSheetController?
-
Controller for programmatic control of the sheet position.
final
- dragHandleColor → Color?
-
Color of the drag handle.
final
- dragHandleSize → Size?
-
Size of the drag handle.
final
- elevation → double?
-
Elevation of the bottom sheet.
final
- handleNestedScroll → bool
-
Whether to enable nested scroll handling.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
Static header widget displayed at the top of the sheet.
final
- headerBuilder → RatioWidgetBuilder?
-
Builder for the header widget that receives the current ratio.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxHeight → double
-
Maximum height of the sheet (fully open position).
final
- minHeight → double
-
Minimum height of the sheet (closed position).
final
- onDragEnd → void Function(double targetRatio)?
-
Called when the user stops dragging the sheet.
final
- onDragStart → VoidCallback?
-
Called when the user starts dragging the sheet.
final
- onSnapComplete → void Function(double targetRatio)?
-
Called when the sheet finishes animating to a snap point.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadowColor → Color?
-
The color of the shadow below the sheet.
final
- shape → ShapeBorder?
-
Shape of the bottom sheet (e.g., rounded corners).
final
- showDragHandle → bool?
-
Whether to show the standard drag handle at the top.
final
-
snapPoints
→ List<
double> -
Positions where the sheet can snap to.
final
- surfaceTintColor → Color?
-
The color used as an overlay on backgroundColor to indicate elevation.
final
- velocityThreshold → double
-
Velocity threshold for fling gesture detection.
final
- width → double?
-
Width of the sheet.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< OverBottomSheet> -
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