ModWheelSlider class
A customizable wheel slider widget that provides wheel-like scrolling appearance.
Supports horizontal and vertical orientations, custom items, haptic feedback, and various visual customization options.
Important: The totalCount parameter represents the number of steps/items,
not the maximum value. The actual values displayed will be from 0 to
totalCount * interval. For example, with totalCount: 10 and interval: 0.5,
the values will be: 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5.
To create a slider from min to max with a specific interval, calculate
totalCount as: ((max - min) / interval).round().
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ModWheelSlider
Constructors
- ModWheelSlider({Key? key, double horizontalListHeight = 50, double horizontalListWidth = double.infinity, double verticalListHeight = 400.0, double verticalListWidth = 50.0, required int totalCount, required num initValue, required dynamic onValueChanged(dynamic), double itemSize = 10, double perspective = 0.0007, bool isInfinite = true, bool horizontal = true, double squeeze = 1.0, Color? lineColor, Color pointerColor = Colors.black, double pointerHeight = 50.0, double pointerWidth = 3.0, Widget? background, bool enableHapticFeedback = true, ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate, bool showPointer = true, Widget? customPointer, ScrollPhysics? scrollPhysics, bool allowPointerTappable = true, num interval = 1, bool enableAnimation = true, Duration animationDuration = const Duration(seconds: 1), Curve animationType = Curves.easeIn, FixedExtentScrollController? controller, ModWheelSliderController? sliderController})
-
Constructs a ModWheelSlider with line-based UI.
const
-
ModWheelSlider.customWidget({Key? key, double horizontalListHeight = 50, double horizontalListWidth = double.infinity, double verticalListHeight = 400.0, double verticalListWidth = 50.0, required int totalCount, required num initValue, required dynamic onValueChanged(dynamic), double itemSize = 10, double perspective = 0.0007, bool isInfinite = true, bool horizontal = true, double squeeze = 1.0, Color pointerColor = Colors.black, double pointerHeight = 50.0, double pointerWidth = 3.0, required List<
Widget> ? children, Widget? background, bool enableHapticFeedback = true, ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate, bool showPointer = true, Widget? customPointer, ScrollPhysics? scrollPhysics, bool allowPointerTappable = true, bool enableAnimation = true, Duration animationDuration = const Duration(seconds: 1), Curve animationType = Curves.easeIn, FixedExtentScrollController? controller, ModWheelSliderController? sliderController}) -
Constructs a ModWheelSlider with custom child widgets.
const
- ModWheelSlider.number({Key? key, double horizontalListHeight = 50, double horizontalListWidth = double.infinity, double verticalListHeight = 400.0, double verticalListWidth = 50.0, required int totalCount, required num initValue, required dynamic onValueChanged(dynamic), double itemSize = 40, double perspective = 0.0007, bool isInfinite = true, bool horizontal = true, double squeeze = 1.0, Color pointerColor = Colors.black, double pointerHeight = 50.0, double pointerWidth = 3.0, Widget? background, bool enableHapticFeedback = true, ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate, bool showPointer = false, Widget? customPointer, TextStyle? selectedNumberStyle = const TextStyle(fontWeight: FontWeight.bold), TextStyle? unSelectedNumberStyle = const TextStyle(), double? selectedNumberWidth, required num? currentIndex, ScrollPhysics? scrollPhysics, bool allowPointerTappable = true, num interval = 1, bool enableAnimation = true, Duration animationDuration = const Duration(seconds: 1), Curve animationType = Curves.easeIn, FixedExtentScrollController? controller, ModWheelSliderController? sliderController})
-
Constructs a ModWheelSlider with numbered UI.
const
Properties
- allowPointerTappable → bool
-
Enables or disables tappable pointer interactions.
final
- animationDuration → Duration
-
Duration of the animation for initial value display.
final
- animationType → Curve
-
Type of animation curve to use.
final
- background → Widget?
-
Background widget displayed behind the slider.
final
-
children
→ List<
Widget> ? -
A list of custom child widgets for the slider.
final
- controller → FixedExtentScrollController?
-
Controller for the scroll position of the slider.
final
- currentIndex → num?
-
Current index for number type slider.
final
- customPointer → Widget?
-
Custom pointer widget.
final
- enableAnimation → bool
-
Enables or disables animation for initial value display.
final
- enableHapticFeedback → bool
-
Enables or disables haptic feedback.
final
- hapticFeedbackType → ModHapticFeedbackType
-
Type of haptic feedback to be used.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- horizontal → bool
-
Sets the orientation of the slider.
truefor horizontal,falsefor vertical.final - horizontalListHeight → double
-
Height of the horizontal list view.
final
- horizontalListWidth → double
-
Width of the horizontal list view.
final
- initValue → num
-
The initial value to display in the slider.
final
- interval → num
-
Interval value between slider steps.
final
- isInfinite → bool
-
Enables or disables infinite scrolling.
final
- itemSize → double
-
Size of each item in the slider.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lineColor → Color?
-
Color of the slider lines.
final
- onValueChanged → dynamic Function(dynamic)
-
Callback function that is triggered when the slider value changes.
final
- perspective → double
-
Perspective effect of the list. Values <= 0.01 are recommended.
final
- pointerColor → Color
-
Color of the pointer.
final
- pointerHeight → double
-
Height of the pointer.
final
- pointerWidth → double
-
Width of the pointer.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollPhysics → ScrollPhysics?
-
Scroll physics for the list view.
final
- selectedNumberStyle → TextStyle?
-
Text style for the selected number in the slider.
final
- selectedNumberWidth → double?
-
Width of the selected number container.
final
- showPointer → bool
-
Determines if the pointer is visible.
final
- sliderController → ModWheelSliderController?
-
External controller for programmatically setting values.
final
- squeeze → double
-
Squeeze factor for the items in the slider.
final
- totalCount → int
-
The total number of steps/items in the slider.
The maximum value will be
totalCount * interval.final - unSelectedNumberStyle → TextStyle?
-
Text style for unselected numbers in the slider.
final
- verticalListHeight → double
-
Height of the vertical list view.
final
- verticalListWidth → double
-
Width of the vertical list view.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ModWheelSlider> -
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