InputNumber constructor

const InputNumber({
  1. Key? id,
  2. required InputNumberState state,
  3. required String message,
  4. String? placeholder,
  5. num? min,
  6. num? max,
  7. num step = 1,
  8. bool allowDecimals = false,
  9. bool allowNegative = true,
  10. num? defaultValue,
  11. String? validate(
    1. num value
    )?,
  12. void onSubmit(
    1. num value
    )?,
  13. void onChanged(
    1. num? value
    )?,
  14. bool lockOnSubmit = true,
  15. String askPrefix = '?',
  16. String errorPrefix = '✗',
  17. String successPrefix = '✓',
  18. Style? messageStyle,
  19. Style? inputStyle,
  20. Style? errorStyle,
  21. Style? askPrefixStyle,
  22. Style? errorPrefixStyle,
  23. Style? successPrefixStyle,
})

Implementation

const InputNumber({
  Key? id,
  required this.state,
  required this.message,
  this.placeholder,
  this.min,
  this.max,
  this.step = 1,
  this.allowDecimals = false,
  this.allowNegative = true,
  this.defaultValue,
  this.validate,
  this.onSubmit,
  this.onChanged,
  this.lockOnSubmit = true,
  this.askPrefix = '?',
  this.errorPrefix = '✗',
  this.successPrefix = '✓',
  this.messageStyle,
  this.inputStyle,
  this.errorStyle,
  this.askPrefixStyle,
  this.errorPrefixStyle,
  this.successPrefixStyle,
})  : _id = id,
      assert(step > 0, 'step must be > 0'),
      assert(min == null || max == null || min <= max, 'min must be <= max');