CupertinoSpinBox constructor
CupertinoSpinBox({
- 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,
- EdgeInsetsGeometry padding = const EdgeInsets.all(6),
- BoxDecoration decoration = _kDefaultRoundedBorderDecoration,
- Brightness? keyboardAppearance,
- Icon? incrementIcon,
- Icon? decrementIcon,
- Widget? prefix,
- Widget? suffix,
- Axis direction = Axis.horizontal,
- TextAlign textAlign = TextAlign.center,
- TextStyle? textStyle,
- ToolbarOptions? toolbarOptions,
- bool? showCursor,
- Color? cursorColor,
- bool enableInteractiveSelection = true,
- double spacing = 8,
- ValueChanged<
double?> ? onChanged,
Creates a spinbox.
Implementation
CupertinoSpinBox({
Key? key,
this.min = 0,
this.max = 100,
this.step = 1,
this.value = 0,
this.interval = const Duration(milliseconds: 100),
this.acceleration,
this.numOfDecimals = 0,
bool? enabled,
this.autofocus = false,
TextInputType? keyboardType,
this.textInputAction,
this.padding = const EdgeInsets.all(6),
this.decoration = _kDefaultRoundedBorderDecoration,
this.keyboardAppearance,
Icon? incrementIcon,
Icon? decrementIcon,
this.prefix,
this.suffix,
this.direction = Axis.horizontal,
this.textAlign = TextAlign.center,
this.textStyle,
this.toolbarOptions,
this.showCursor,
this.cursorColor,
this.enableInteractiveSelection = true,
this.spacing = 8,
this.onChanged,
}) : keyboardType = keyboardType ??
TextInputType.numberWithOptions(
signed: min < 0,
decimal: numOfDecimals > 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);