DesignWheelPicker class
A wheel picker of linked columns: selection holds a row per column, columns gives the columns for a selection, and onChanged gets every pick as a whole, valid selection.
Each column turns on a ListWheelScrollView of the look's shape
(diameterRatio, perspective, offAxisFraction, squeeze,
useMagnifier, magnification, overAndUnderCenterOpacity: its names,
CupertinoPicker's defaults). A fling settles on its rows; a key, a tap
on a row, a screen reader's step and a parent's new selection turn the
wheel on a spring (dampingRatio, stiffness), critically damped under
Reduce Motion. A row crossing the centre plays
DesignHaptics.selectionChanged, at most once a frame (a fast turn's
rows would blur into one anyway).
Keys, each column one tab stop: Down and Up the next and previous live row (wrapping when the column loops), Page Down and Page Up five rows, Home and End the first and last live row, letters and digits the next row whose name starts with what was typed in the last second, Left and Right the column before and after as drawn (mirrored right to left).
DesignWheelPicker(columns: (selection) => [DesignWheelColumn(itemCount: 24, itemLabel: (index) => '$index', semanticLabel: 'Hour', looping: true)], selection: const [9], onChanged: (selection) {}, itemExtent: 40, itemBuilder: (context, details) => Center(child: Text(details.label)))
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DesignWheelPicker
Constructors
-
DesignWheelPicker({Key? key, required List<
DesignWheelColumn> columns(List<int> selection), required List<int> selection, required ValueChanged<List< ? onChanged, required double itemExtent, required DesignWheelItemBuilder itemBuilder, DesignWheelColumnBuilder? columnBuilder, Widget layoutBuilder(BuildContext context, List<int> >Widget> columns)?, int visibleItemCount = 5, double diameterRatio = 1.07, double perspective = 0.003, double offAxisFraction = 0, double squeeze = 1.45, bool useMagnifier = false, double magnification = 1, double overAndUnderCenterOpacity = 1, String? semanticLabel, bool autofocus = false, double dampingRatio = 1, double stiffness = 700}) -
A picker showing
selectionin thecolumnsit gives.const
Properties
- autofocus → bool
-
Whether the first column takes focus when it first shows.
final
- columnBuilder → DesignWheelColumnBuilder?
-
Frames a column round its wheel; null: the wheel alone.
final
-
columns
→ List<
DesignWheelColumn> Function(List<int> selection) -
The columns for a selection: called with the selection a pick makes,
so a column's rows can follow the others' (a month's days).
final
- dampingRatio → double
-
The turning spring's damping ratio (ζ). Defaults to 1.
final
- diameterRatio → double
-
ListWheelScrollView.diameterRatio: the wheel's diameter over its height. Defaults toCupertinoPicker's, 1.07; a large ratio flattens it.final - hashCode → int
-
The hash code for this object.
no setterinherited
- itemBuilder → DesignWheelItemBuilder
-
Paints a row.
final
- itemExtent → double
-
The height of a row.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
layoutBuilder
→ Widget Function(BuildContext context, List<
Widget> columns)? -
Lays the framed columns out; null: a Row with each column
Expanded.
final
- magnification → double
-
ListWheelScrollView.magnification. Defaults to 1.final - offAxisFraction → double
-
ListWheelScrollView.offAxisFraction: how far the wheel's axis leans off the centre. Defaults to 0.final -
onChanged
→ ValueChanged<
List< ?int> > -
Called with the whole selection when a column comes to rest on a new
row, after every other column has moved to a live row.
final
- overAndUnderCenterOpacity → double
-
ListWheelScrollView.overAndUnderCenterOpacity. Defaults to 1.final - perspective → double
-
ListWheelScrollView.perspective. Defaults to 0.003.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selection
→ List<
int> -
The row chosen in each column, one per column.
final
- semanticLabel → String?
-
What a screen reader calls the whole picker ("Date"); null: nothing.
final
- squeeze → double
-
ListWheelScrollView.squeeze: how close the rows stand. Defaults toCupertinoPicker's, 1.45.final - stiffness → double
-
The turning spring's stiffness (k). Defaults to 700.
final
- useMagnifier → bool
-
ListWheelScrollView.useMagnifier. Defaults to false.final - visibleItemCount → int
-
How many rows tall a column is. Defaults to 5.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DesignWheelPicker> -
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, 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