ZdsSlidableButton class

A SlidableButton with pre-applied Zds styling. This grows to the width of its container.

Inheritance
Available Extensions

Constructors

ZdsSlidableButton({required Color buttonSliderColor, required String buttonText, required IconData buttonIcon, required Color buttonColor, void onTapDown()?, Future<bool> onSlideComplete()?, bool animate = true, Color? buttonSliderColorEnd, Color? buttonColorEnd, String? buttonTextEnd, IconData? buttonIconEnd, bool stayCompleted = false, String? disabledMessage, Duration completedDisplayDuration = const Duration(seconds: 2), double handleWidth = 160, double height = 64, Key? key})
A button slider with a ZdsSlidableWidget as a child, the ZdsSlidableWidget is the slidable element.
const

Properties

animate bool
Button animation after slide, this is defaulted to false for no animation
final
buttonColor Color
Button color
final
buttonColorEnd Color?
Button color when toggled
final
buttonIcon IconData
Button Icon when toggled
final
buttonIconEnd IconData?
Button Icon when toggled
final
buttonSliderColor Color
Button background color
final
buttonSliderColorEnd Color?
Button background color when toggled
final
buttonText String
Button center text
final
buttonTextEnd String?
Button center text when toggled
final
completedDisplayDuration Duration
The duration to show the completed widget before the toggle resets. Will not do anything if stayCompleted is set to true
final
disabledMessage String?
The message to be displayed when the button is disabled. Only shows if onSlideComplete is null.
final
handleWidth double
The width of the button handle
final
hashCode int
The hash code for this object.
no setterinherited
height double
The height of the button
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSlideComplete → (Future<bool> Function()?)
The future that is called when the button has been slid. While it is being awaited, a loading indicator will show. If the future returns true, the text and colors will be switched out for their 'end' equivalents If included the button is active, if not it will be disabled.
final
onTapDown → (void Function()?)
Called when the handle is tapped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stayCompleted bool
Keeps the toggle at one end after completion
final

Methods

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