CupertinoSpinBox constructor
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()?,
- bool canChange(
- double value
- VoidCallback? beforeChange,
- VoidCallback? afterChange,
- FocusNode? focusNode,
Creates a spinbox.
Implementation
CupertinoSpinBox({
Key? key,
this.min = 0,
this.max = 100,
this.step = 1,
this.pageStep,
this.value = 0,
this.interval = const Duration(milliseconds: 100),
this.acceleration,
this.digits = 0,
this.decimals = 0,
bool? enabled,
this.readOnly = false,
this.autofocus = false,
TextInputType? keyboardType,
this.textInputAction,
this.padding = const EdgeInsets.all(6),
this.decoration = _kDefaultRoundedBorderDecoration,
this.keyboardAppearance,
Icon? incrementIcon,
Icon? decrementIcon,
this.showButtons = true,
this.prefix,
this.suffix,
this.direction = Axis.horizontal,
this.textAlign = TextAlign.center,
this.textStyle,
this.contextMenuBuilder,
this.showCursor,
this.cursorColor,
this.enableInteractiveSelection = true,
this.spacing = 8,
this.onChanged,
this.onSubmitted,
this.canChange,
this.beforeChange,
this.afterChange,
this.focusNode,
}) : assert(min <= max),
keyboardType = keyboardType ??
TextInputType.numberWithOptions(
signed: min < 0,
decimal: decimals > 0,
),
enabled = (enabled ?? true) && min < max,
//decoration = decoration ?? const BoxDecoration(),
incrementIcon =
incrementIcon ?? const Icon(CupertinoIcons.plus_circled),
decrementIcon =
decrementIcon ?? const Icon(CupertinoIcons.minus_circled),
super(key: key);