CupertinoSpinBox constructor

CupertinoSpinBox({
  1. Key? key,
  2. double min = 0,
  3. double max = 100,
  4. double step = 1,
  5. double value = 0,
  6. Duration interval = const Duration(milliseconds: 100),
  7. double? acceleration,
  8. int numOfDecimals = 0,
  9. bool? enabled,
  10. bool autofocus = false,
  11. TextInputType? keyboardType,
  12. TextInputAction? textInputAction,
  13. EdgeInsetsGeometry padding = const EdgeInsets.all(6),
  14. BoxDecoration decoration = _kDefaultRoundedBorderDecoration,
  15. Brightness? keyboardAppearance,
  16. Icon? incrementIcon,
  17. Icon? decrementIcon,
  18. Widget? prefix,
  19. Widget? suffix,
  20. Axis direction = Axis.horizontal,
  21. TextAlign textAlign = TextAlign.center,
  22. TextStyle? textStyle,
  23. ToolbarOptions? toolbarOptions,
  24. bool? showCursor,
  25. Color? cursorColor,
  26. bool enableInteractiveSelection = true,
  27. double spacing = 8,
  28. 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);