DraggableBottomSheet class
Draggable bottom sheet based on DraggableScrollableSheet
This widget can be dragged along the vertical axis between its
minChildSize, which defaults to 0.2
and maxChildSize, which defaults
to 1.0
. The initialChildSize defaults to 0.6
These sizes are percentages of the height of the parent container.
When running on web initialChildSize is equal to maxChildSize since drag is not supported
minFocusableExtent defines the minimum extent within the content can be focused, defaults to 0.5
.
This means that if you scroll down the BottomSheet lower that the 50% of the container height, the current focus is
cleared and the content will not be focusable until the extent returns over the threshold.
Setting this value to 0 means disabling focus check and content will be always focusable
If updateInsets is true, the bottom inset of MediaQuery will be updated as long as the extent changes. This means that if you are using a Scaffold inside this BottomSheet with Scaffold.resizeToAvoidBottomInset true it will automatically resized with a fluid animation. You may have to wrap that scaffold body with a SingleChildScrollView with NeverScrollableScrollPhysics to avoid bottom overflow when scrolling down the BottomSheet When running on web this field is ignored since drag is not supported
builder allows you to build the content basing on DraggableScrollableNotification
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DraggableBottomSheet
Constructors
- DraggableBottomSheet.new({Key? key, double initialChildSize = .6, double minChildSize = .2, double maxChildSize = 1, double minFocusableExtent = .5, double? contentHeight, bool updateInsets = true, required Widget builder(BuildContext context, DraggableScrollableNotification notification)})
-
const
Properties
- builder → Widget Function(BuildContext context, DraggableScrollableNotification notification)
-
final
- contentHeight → double?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialChildSize → double
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxChildSize → double
-
final
- minChildSize → double
-
final
- minFocusableExtent → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- updateInsets → bool
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DraggableBottomSheet> -
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.
override
-
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
Static Methods
-
controllerOf(
BuildContext context) → ScrollController