CupertinoSpinBox class

An iOS-style spinbox.

A numeric input widget with an input field for entering a specific value, and spin buttons for quick, convenient, and accurate value adjustments.

CupertinoSpinBox

import 'package:flutter_spinbox/cupertino.dart'; // or flutter_spinbox.dart for both

CupertinoSpinBox(
  min: 1,
  max: 100,
  value: 50,
  onChanged: (value) => print(value),
)

See also Cupertino (iOS-style) widgets package.

Inheritance

Constructors

CupertinoSpinBox({Key? key, double min = 0, double max = 100, double step = 1, double? pageStep, double value = 0, Duration interval = const Duration(milliseconds: 100), double? acceleration, int digits = 0, int decimals = 0, bool? enabled, bool readOnly = false, bool autofocus = false, TextInputType? keyboardType, TextInputAction? textInputAction, EdgeInsetsGeometry padding = const EdgeInsets.all(6), BoxDecoration decoration = _kDefaultRoundedBorderDecoration, Brightness? keyboardAppearance, Icon? incrementIcon, Icon? decrementIcon, bool showButtons = true, Widget? prefix, Widget? suffix, Axis direction = Axis.horizontal, TextAlign textAlign = TextAlign.center, TextStyle? textStyle, EditableTextContextMenuBuilder? contextMenuBuilder, bool? showCursor, Color? cursorColor, bool enableInteractiveSelection = true, double spacing = 8, ValueChanged<double>? onChanged, void onSubmitted(double)?, bool canChange(double value)?, VoidCallback? beforeChange, VoidCallback? afterChange, FocusNode? focusNode})
Creates a spinbox.

Properties

acceleration double?
The amount of acceleration that is added to the value on each step.
final
afterChange VoidCallback?
final
autofocus bool
See CupertinoTextField.autofocus.
final
beforeChange VoidCallback?
final
canChange → (bool Function(double value)?)
final
contextMenuBuilder EditableTextContextMenuBuilder?
See CupertinoTextField.contextMenuBuilder.
final
cursorColor Color?
See CupertinoTextField.cursorColor.
final
decimals int
The number of decimal places used for formatting the value.
final
decoration BoxDecoration
See CupertinoTextField.decoration.
final
decrementIcon Icon
The visual icon for the decrement button.
final
digits int
The number of digits used for formatting the value.
final
direction Axis
The visual direction of the spinbox layout.
final
enabled bool
See CupertinoTextField.enabled.
final
enableInteractiveSelection bool
See CupertinoTextField.enableInteractiveSelection.
final
focusNode FocusNode?
See TextField.focusNode.
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 CupertinoTextField.keyboardAppearance.
final
keyboardType TextInputType
See CupertinoTextField.keyboardType.
final
max double
The maximum value the user can enter.
final
min double
The minimum value the user can enter.
final
onChanged ValueChanged<double>?
Called when the user has changed the value.
final
onSubmitted → (void Function(double)?)
See TextField.onSubmitted.
final
padding EdgeInsetsGeometry
See CupertinoTextField.padding.
final
pageStep double?
An optional page step size for incrementing and decrementing the value.
final
prefix Widget?
See CupertinoTextField.prefix.
final
readOnly bool
See TextField.readOnly.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showButtons bool
Whether the increment and decrement buttons are shown.
final
showCursor bool?
See CupertinoTextField.showCursor.
final
spacing double
The visual spacing of the spinbox layout.
final
step double
The step size for incrementing and decrementing the value.
final
suffix Widget?
See CupertinoTextField.suffix.
final
textAlign TextAlign
See CupertinoTextField.textAlign.
final
textInputAction TextInputAction?
See CupertinoTextField.textInputAction.
final
textStyle TextStyle?
See CupertinoTextField.style.
final
value double
The current value.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CupertinoSpinBox>
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}) 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