SlidingUpPanel class

Inheritance

Constructors

SlidingUpPanel({Key? key, Widget? panel, Widget panelBuilder(ScrollController sc)?, Widget? body, Widget? collapsed, double minHeight = 100.0, double maxHeight = 500.0, double? snapPoint, Border? border, BorderRadiusGeometry? borderRadius, List<BoxShadow>? boxShadow = const <BoxShadow>[BoxShadow(blurRadius: 8.0, color: Color.fromRGBO(0, 0, 0, 0.25))], Color color = Colors.white, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, bool renderPanelSheet = true, bool panelSnapping = true, PanelController? controller, bool backdropEnabled = false, Color backdropColor = Colors.black, double backdropOpacity = 0.5, bool backdropTapClosesPanel = true, void onPanelSlide(double position)?, VoidCallback? onPanelOpened, VoidCallback? onPanelClosed, bool parallaxEnabled = false, double parallaxOffset = 0.1, bool isDraggable = true, SlideDirection slideDirection = SlideDirection.UP, PanelState defaultPanelState = PanelState.CLOSED, Widget? header, Widget? footer})

Properties

backdropColor Color
Shows a darkening shadow of this Color over the body as the panel slides open.
final
backdropEnabled bool
If non-null, shows a darkening shadow over the body as the panel slides open.
final
backdropOpacity double
The opacity of the backdrop when the panel is fully open. This value can range from 0.0 to 1.0 where 0.0 is completely transparent and 1.0 is completely opaque.
final
backdropTapClosesPanel bool
Flag that indicates whether or not tapping the backdrop closes the panel. Defaults to true.
final
body Widget?
The Widget that lies underneath the sliding panel. This Widget automatically sizes itself to fill the screen.
final
border Border?
A border to draw around the sliding panel sheet.
final
borderRadius BorderRadiusGeometry?
If non-null, the corners of the sliding panel sheet are rounded by this BorderRadiusGeometry.
final
boxShadow List<BoxShadow>?
A list of shadows cast behind the sliding panel sheet.
final
collapsed Widget?
The Widget displayed overtop the panel when collapsed. This fades out as the panel is opened.
final
color Color
The color to fill the background of the sliding panel sheet.
final
controller PanelController?
If non-null, this can be used to control the state of the panel.
final
defaultPanelState PanelState
The default state of the panel; either PanelState.OPEN or PanelState.CLOSED. This value defaults to PanelState.CLOSED which indicates that the panel is in the closed position and must be opened. PanelState.OPEN indicates that by default the Panel is open and must be swiped closed by the user.
final
Optional persistent widget that floats above the panel and attaches to the bottom of the panel. Content at the bottom of the panel will be covered by this widget. Add padding to the bottom of the panel to avoid coverage.
final
hashCode int
The hash code for this object.
no setterinherited
Optional persistent widget that floats above the panel and attaches to the top of the panel. Content at the top of the panel will be covered by this widget. Add padding to the bottom of the panel to avoid coverage.
final
isDraggable bool
Allows toggling of the draggability of the SlidingUpPanel. Set this to false to prevent the user from being able to drag the panel up and down. Defaults to true.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry?
Empty space surrounding the sliding panel sheet.
final
maxHeight double
The height of the sliding panel when fully open.
final
minHeight double
The height of the sliding panel when fully collapsed.
final
onPanelClosed VoidCallback?
If non-null, this callback is called when the panel is fully collapsed.
final
onPanelOpened VoidCallback?
If non-null, this callback is called when the panel is fully opened
final
onPanelSlide → (void Function(double position)?)
If non-null, this callback is called as the panel slides around with the current position of the panel. The position is a double between 0.0 and 1.0 where 0.0 is fully collapsed and 1.0 is fully open.
final
padding EdgeInsetsGeometry?
The amount to inset the children of the sliding panel sheet.
final
panel Widget?
The Widget that slides into view. When the panel is collapsed and if collapsed is null, then top portion of this Widget will be displayed; otherwise, collapsed will be displayed overtop of this Widget. If panel and panelBuilder are both non-null, panel will be used.
final
panelBuilder → (Widget Function(ScrollController sc)?)
WARNING: This feature is still in beta and is subject to change without notice. Stability is not gauranteed. Provides a ScrollController and ScrollPhysics to attach to a scrollable object in the panel that links the panel position with the scroll position. Useful for implementing an infinite scroll behavior. If panel and panelBuilder are both non-null, panel will be used.
final
panelSnapping bool
Set to false to disable the panel from snapping open or closed.
final
parallaxEnabled bool
If non-null and true, the SlidingUpPanel exhibits a parallax effect as the panel slides up. Essentially, the body slides up as the panel slides up.
final
parallaxOffset double
Allows for specifying the extent of the parallax effect in terms of the percentage the panel has slid up/down. Recommended values are within 0.0 and 1.0 where 0.0 is no parallax and 1.0 mimics a one-to-one scrolling effect. Defaults to a 10% parallax.
final
renderPanelSheet bool
Set to false to not to render the sheet the panel sits upon. This means that only the body, collapsed, and the panel Widgets will be rendered. Set this to false if you want to achieve a floating effect or want more customization over how the sliding panel looks like.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slideDirection SlideDirection
Either SlideDirection.UP or SlideDirection.DOWN. Indicates which way the panel should slide. Defaults to UP. If set to DOWN, the panel attaches itself to the top of the screen and is fully opened when the user swipes down on the panel.
final
snapPoint double?
A point between minHeight and maxHeight that the panel snaps to while animating. A fast swipe on the panel will disregard this point and go directly to the open/close position. This value is represented as a percentage of the total animation distance (maxHeight - minHeight), so it must be between 0.0 and 1.0, exclusive.
final

Methods

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