ExpandableBottomSheet class
ExpandableBottomSheet is a BottomSheet with a draggable height like the Google Maps App on Android.
Example:
ExpandableBottomSheet(
background: Container(
color: Colors.red,
child: Center(
child: Text('Background'),
),
),
persistentHeader: Container(
height: 40,
color: Colors.blue,
child: Center(
child: Text('Header'),
),
),
expandableContent: Container(
height: 500,
color: Colors.green,
child: Center(
child: Text('Content'),
),
),
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ExpandableBottomSheet
Constructors
- ExpandableBottomSheet({Key? key, required Widget expandableContent, required Widget background, Widget? persistentHeader, double persistentContentHeight = 0.0, Curve animationCurveExpand = Curves.ease, Curve animationCurveContract = Curves.ease, Duration animationDurationExtend = const Duration(milliseconds: 250), Duration animationDurationContract = const Duration(milliseconds: 250), dynamic onIsExtendedCallback()?, dynamic onIsContractedCallback()?, bool enableToggle = false})
-
Creates the ExpandableBottomSheet.
const
Properties
- animationCurveContract → Curve
-
animationCurveContract is the curve of the animation for contracting
the expandableContent if the drag ended with high speed.
final
- animationCurveExpand → Curve
-
animationCurveExpand is the curve of the animation for expanding
the expandableContent if the drag ended with high speed.
final
- animationDurationContract → Duration
-
animationDurationContract is the duration for the animation to bottom
if you stop dragging with high speed. If it is
null
animationDurationExtend will be used.final - animationDurationExtend → Duration
-
animationDurationExtend is the duration for the animation if you stop
dragging with high speed.
final
- background → Widget
-
background is the widget behind the expandableContent which holds
usually the content of your page. It is required for the ExpandableBottomSheet.
final
- enableToggle → bool
-
enableToggle will enable tap to toggle option on header.
final
- expandableContent → Widget
-
expandableContent is the widget which you can hide and show by dragging.
It has to be a widget with a constant height. It is required for the ExpandableBottomSheet.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onIsContractedCallback → (dynamic Function()?)
-
onIsContractedCallback will be executed if the extend reaches its minimum.
final
- onIsExtendedCallback → (dynamic Function()?)
-
onIsExtendedCallback will be executed if the extend reaches its maximum.
final
- persistentContentHeight → double
-
persistentContentHeight is the height of the content which will never
been contracted. It only relates to expandableContent. persistentHeader
and persistentFooter will not be affected by this.
final
-
persistentFooter is a widget which is always shown at the bottom. The expandableContent
is if it is expanded on top of it so you don't need margin to see all of
your content. You can use it for example for navigation or a menu.
final
- persistentHeader → Widget?
-
persistentHeader is a Widget which is on top of the expandableContent
and will never be hidden. It is made for a widget which indicates the
user he can expand the content by dragging.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → ExpandableBottomSheetState -
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