GlassSlideToConfirm class

A glass capsule with a round knob to slide across, for actions worth a second thought, as "slide to power off".

Let go past threshold of the way and the knob snaps to the end, shows a tick and calls onConfirmed; let go short of it and it springs back.

Inheritance

Constructors

GlassSlideToConfirm.new({Key? key, required VoidCallback? onConfirmed, String label = 'Slide to confirm', String? confirmedLabel, Duration? resetAfter, double threshold = 0.9, double height = 56, Color? activeColor, bool shimmer = true, String? semanticLabel, FocusNode? focusNode, bool autofocus = false})
Creates a slide to confirm; threshold must be above 0 and at most 1, and height at least 32.
const

Properties

activeColor → Color?
The fill behind the knob. Defaults to the theme's accent.
final
autofocus → bool
Whether it takes focus when first built.
final
confirmedLabel → String?
Shown on the filled track once confirmed, if set.
final
focusNode → FocusNode?
The control's focus node, to drive or watch its focus.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
The track's height.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label → String
The words on the track.
final
onConfirmed → VoidCallback?
Called once the slide is confirmed. Null disables the control.
final
resetAfter → Duration?
If set, how long after confirming the knob springs back to the start.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
Defaults to label.
final
shimmer → bool
Whether the label shimmers. It never does under reduced motion.
final
threshold → double
How far along, from 0 to 1, the knob must be let go to confirm.
final

Methods

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