SpinBox constructor

SpinBox({
  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. InputDecoration? decoration,
  14. FormFieldValidator<String>? validator,
  15. Brightness? keyboardAppearance,
  16. Icon? incrementIcon,
  17. Icon? decrementIcon,
  18. Axis direction = Axis.horizontal,
  19. TextAlign textAlign = TextAlign.center,
  20. TextDirection textDirection = TextDirection.ltr,
  21. TextStyle? textStyle,
  22. ToolbarOptions? toolbarOptions,
  23. bool? showCursor,
  24. Color? cursorColor,
  25. bool enableInteractiveSelection = true,
  26. double spacing = 8,
  27. ValueChanged<double?>? onChanged,
})

Creates a spinbpx.

Implementation

SpinBox({
  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,
  InputDecoration? decoration,
  this.validator,
  this.keyboardAppearance,
  Icon? incrementIcon,
  Icon? decrementIcon,
  this.direction = Axis.horizontal,
  this.textAlign = TextAlign.center,
  this.textDirection = TextDirection.ltr,
  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 InputDecoration(),
      incrementIcon = incrementIcon ?? const Icon(Icons.add),
      decrementIcon = decrementIcon ?? const Icon(Icons.remove),
      super(key: key) {
  assert(this.decoration.prefixIcon == null,
      'InputDecoration.prefixIcon is reserved for SpinBox decrement icon');
  assert(this.decoration.suffixIcon == null,
      'InputDecoration.suffixIcon is reserved for SpinBox increment icon');
}