NumberBox<T extends num> constructor

const NumberBox<T extends num>({
  1. Key? key,
  2. required T? value,
  3. required ValueChanged<T?>? onChanged,
  4. ValueChanged<String>? onTextChange,
  5. FocusNode? focusNode,
  6. SpinButtonPlacementMode mode = SpinButtonPlacementMode.compact,
  7. bool clearButton = true,
  8. num smallChange = 1,
  9. num largeChange = 10,
  10. int precision = 2,
  11. num? min,
  12. num? max,
  13. bool allowExpressions = false,
  14. Widget? leadingIcon,
  15. bool autofocus = false,
  16. List<TextInputFormatter>? inputFormatters,
  17. String? placeholder,
  18. TextStyle? placeholderStyle,
  19. double cursorWidth = 1.5,
  20. Radius cursorRadius = const Radius.circular(2.0),
  21. double? cursorHeight,
  22. Color? cursorColor,
  23. bool? showCursor,
  24. Color? highlightColor,
  25. Color? unfocusedColor,
  26. TextStyle? style,
  27. TextAlign? textAlign,
  28. TextInputType? keyboardType = TextInputType.number,
  29. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  30. bool enableInteractiveSelection = true,
  31. Brightness? keyboardAppearance,
  32. ScrollController? scrollController,
  33. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  34. ScrollPhysics? scrollPhysics,
  35. TextSelectionControls? selectionControls,
  36. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  37. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  38. TextDirection? textDirection,
})

Creates a number box.

Implementation

const NumberBox({
  super.key,
  required this.value,
  required this.onChanged,
  this.onTextChange,
  this.focusNode,
  this.mode = SpinButtonPlacementMode.compact,
  this.clearButton = true,
  this.smallChange = 1,
  this.largeChange = 10,
  this.precision = 2,
  this.min,
  this.max,
  this.allowExpressions = false,
  this.leadingIcon,
  this.autofocus = false,
  this.inputFormatters,
  this.placeholder,
  this.placeholderStyle,
  this.cursorWidth = 1.5,
  this.cursorRadius = const Radius.circular(2.0),
  this.cursorHeight,
  this.cursorColor,
  this.showCursor,
  this.highlightColor,
  this.unfocusedColor,
  this.style,
  this.textAlign,
  this.keyboardType = TextInputType.number,
  this.dragStartBehavior = DragStartBehavior.start,
  this.enableInteractiveSelection = true,
  this.keyboardAppearance,
  this.scrollController,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.scrollPhysics,
  this.selectionControls,
  this.selectionHeightStyle = ui.BoxHeightStyle.tight,
  this.selectionWidthStyle = ui.BoxWidthStyle.tight,
  this.textDirection,
});