HapticSlider class

Slider that fires a haptic tick whenever the value crosses a discrete detent — like the iOS picker wheel.

If divisions is provided, ticks fire at every step. Otherwise ticks fire at thresholds defined by tickEvery (in value units, e.g. every 0.1 for a 0..1 slider).

HapticSlider(
  value: _v,
  min: 0,
  max: 100,
  divisions: 10,                              // tick every 10 units
  onChanged: (v) => setState(() => _v = v),
)
Inheritance

Constructors

HapticSlider({Key? key, required double value, required ValueChanged<double> onChanged, double min = 0.0, double max = 1.0, int? divisions, double? tickEvery, String? label, Color? activeColor, HapticImpactStyle tickStyle = HapticImpactStyle.light, HapticImpactStyle endTickStyle = HapticImpactStyle.medium})
const

Properties

activeColor → Color?
final
divisions → int?
Discrete divisions. Mutually exclusive with tickEvery in semantics but if both are set, divisions wins.
final
endTickStyle → HapticImpactStyle
Haptic style for the min and max endpoints.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label → String?
final
max → double
final
min → double
final
onChanged → ValueChanged<double>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tickEvery → double?
Distance between ticks in value units (used when divisions is null).
final
tickStyle → HapticImpactStyle
Haptic style for intermediate ticks.
final
value → double
final

Methods

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