WheelPickerController class
Controller for managing and synchronizing WheelPicker
widgets.
The WheelPickerController
allows you to:
- Retrieve the selected item index.
- Shift the attached
WheelPicker
widget. - Mount additional
WheelPickerController
instances, which will be shifted when looped.
It provides precise control over scrolling and synchronization of multiple WheelPicker
widgets.
To use this controller:
- Create an instance of
WheelPickerController
. - Connect it to one or more
WheelPicker
widgets using thecontroller
property. - Use its methods to manipulate the selected item index and scrolling behavior.
Constructors
-
WheelPickerController({required int itemCount, int initialIndex = 0, List<
WheelPickerController> ? mounts}) -
Creates a
WheelPickerController
with optional settings.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialIndex → int
-
The initial selected item index.
final
- itemCount → int
-
The total number of items in the wheel.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → int
-
The current selected item index.
no setter
Methods
-
dispose(
) → void - Disposes of the controller and its resources.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shiftBy(
{required int steps}) → Future< void> - Shifts the wheel by a specified number of items.
-
shiftDown(
) → Future< void> - Shifts the wheel down by one item.
-
shiftUp(
) → Future< void> - Shifts the wheel up by one item.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited