TwoDirectionalSlider class
A widget that allows interactive two-directional sliding gestures.
The TwoDirectionalSlider
widget wraps a child widget and allows users to perform sliding gestures
both vertically and horizontally. It can be configured with callbacks to notify the parent widget
about the changes in the vertical and horizontal values.
The vertical sliding gesture is handled through the onVerticalChanged callback, which receives a double value representing the current vertical position. The verticalDivisions property can be used to discretize the vertical values into a specified number of divisions.
The horizontal sliding gesture is handled through the onHorizontalChanged callback, which receives a double value representing the current horizontal position. The horizontalDivisions property can be used to discretize the horizontal values into a specified number of divisions.
Example usage:
TwoDirectionalSlider(
onVerticalChanged: (value) {
// Handle vertical value changes
},
onHorizontalChanged: (value) {
// Handle horizontal value changes
},
child: Container(
// Child widget
),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TwoDirectionalSlider
Constructors
-
TwoDirectionalSlider({Key? key, required Widget child, double initialVerticalValue = 0.0, double initialHorizontalValue = 0.0, ValueChanged<
double> ? onVerticalChangeStart, ValueChanged<double> ? onVerticalChanged, ValueChanged<double> ? onVerticalChangeEnd, int? verticalDivisions, ValueChanged<double> ? onHorizontalChangeStart, ValueChanged<double> ? onHorizontalChanged, ValueChanged<double> ? onHorizontalChangeEnd, int? horizontalDivisions}) -
Creates a two-directional slider.
const
Properties
- child → Widget
-
The child widget wrapped by the slider.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- horizontalDivisions → int?
-
The number of divisions to discretize the horizontal values.
final
- initialHorizontalValue → double
-
The initial horizontal drag value.
final
- initialVerticalValue → double
-
The initial vertical drag value.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onHorizontalChanged
→ ValueChanged<
double> ? -
Called when the horizontal value changes.
final
-
onHorizontalChangeEnd
→ ValueChanged<
double> ? -
Called when the horizontal value stops changing.
final
-
onHorizontalChangeStart
→ ValueChanged<
double> ? -
Called when the horizontal value starts changing.
final
-
onVerticalChanged
→ ValueChanged<
double> ? -
Called when the vertical value changes.
final
-
onVerticalChangeEnd
→ ValueChanged<
double> ? -
Called when the vertical value stops changing.
final
-
onVerticalChangeStart
→ ValueChanged<
double> ? -
Called when the vertical value starts changing.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- verticalDivisions → int?
-
The number of divisions to discretize the vertical values.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< TwoDirectionalSlider> -
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