SpinBox class
A material design spinbox.
A numeric input widget with an input field for entering a specific value, and spin buttons for quick, convenient, and accurate value adjustments.
import 'package:flutter_spinbox/material.dart'; // or flutter_spinbox.dart for both
SpinBox(
min: 1,
max: 100,
value: 50,
onChanged: (value) => print(value),
)
See also Material Components widgets package.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SpinBox
Constructors
-
SpinBox.new({Key? key, double min = 0, double max = 100, double step = 1, double value = 0, Duration interval = const Duration(milliseconds: 100), double? acceleration, int numOfDecimals = 0, bool? enabled, bool autofocus = false, TextInputType? keyboardType, TextInputAction? textInputAction, InputDecoration? decoration, FormFieldValidator<
String> ? validator, Brightness? keyboardAppearance, Icon? incrementIcon, Icon? decrementIcon, Axis direction = Axis.horizontal, TextAlign textAlign = TextAlign.center, TextDirection textDirection = TextDirection.ltr, TextStyle? textStyle, ToolbarOptions? toolbarOptions, bool? showCursor, Color? cursorColor, bool enableInteractiveSelection = true, double spacing = 8, ValueChanged<double?> ? onChanged}) - Creates a spinbpx.
Properties
- acceleration → double?
-
The amount of acceleration that is added to the value on each step.
final
- autofocus → bool
-
See TextField.autofocus.
final
- cursorColor → Color?
-
See TextField.cursorColor.
final
- decoration → InputDecoration
-
See TextField.decoration.
final
- decrementIcon → Icon
-
The visual icon for the decrement button.
final
- direction → Axis
-
The visual direction of the spinbox layout.
final
- enabled → bool
-
See TextField.enabled.
final
- enableInteractiveSelection → bool
-
See TextField.enableInteractiveSelection.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- incrementIcon → Icon
-
The visual icon for the increment button.
final
- interval → Duration
-
The interval used for auto-incrementing and -decrementing.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardAppearance → Brightness?
-
See TextField.keyboardAppearance.
final
- keyboardType → TextInputType
-
See TextField.keyboardType.
final
- max → double
-
The maximum value the user can enter.
final
- min → double
-
The minimum value the user can enter.
final
- numOfDecimals → int
-
The number of decimal places used for formatting the value.
Defaults to
0
final -
onChanged
→ ValueChanged<
double?> ? -
Called when the user has changed the value.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCursor → bool?
-
See TextField.showCursor.
final
- spacing → double
-
The visual spacing of the spinbox layout.
final
- step → double
-
The step size for incrementing and decrementing the value.
final
- textAlign → TextAlign
-
See TextField.textAlign.
final
- textDirection → TextDirection
-
See TextField.textDirection.
final
- textInputAction → TextInputAction?
-
See TextField.textInputAction.
final
- textStyle → TextStyle?
-
See TextField.style.
final
- toolbarOptions → ToolbarOptions?
-
See TextField.toolbarOptions.
final
-
validator
→ FormFieldValidator<
String> ? -
See FormField.validator.
final
- value → double
-
The current value.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _SpinBoxState -
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