IntField.max constructor

IntField.max(
  1. int max, {
  2. bool trim = false,
  3. FormFieldValidator<String>? validator,
  4. String? blank,
  5. String? malformed,
  6. String? large,
  7. String? initialValue,
  8. TextEditingController? controller,
  9. InputDecoration? decoration = const InputDecoration(),
  10. TextInputAction? textInputAction,
  11. TextStyle? style,
  12. TextDirection? textDirection,
  13. TextAlign textAlign = TextAlign.start,
  14. bool readOnly = false,
  15. String obscuringCharacter = '•',
  16. bool obscureText = false,
  17. bool autocorrect = true,
  18. int? maxLength,
  19. ValueChanged<String>? onChanged,
  20. VoidCallback? onEditingComplete,
  21. ValueChanged<String>? onFieldSubmitted,
  22. FormFieldSetter<String>? onSaved,
  23. bool? enabled,
  24. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  25. bool enableInteractiveSelection = true,
  26. AutovalidateMode? autovalidateMode,
  27. Key? key,
})

Constrains data to integer values that are less than or equal to max.

max the largest valid integer number. trim whether or not to trim the input value. validator an optional extra validation step. blank the error message in case of blank field; if omitted, the field will not be made required. malformed the error message for non-integer input values. large the error message if an input interger number is too large.

Implementation

IntField.max(
  int max, {
  bool trim = false,
  FormFieldValidator<String>? validator,
  String? blank,
  String? malformed,
  String? large,
  String? initialValue,
  TextEditingController? controller,
  InputDecoration? decoration = const InputDecoration(),
  TextInputAction? textInputAction,
  TextStyle? style,
  TextDirection? textDirection,
  TextAlign textAlign = TextAlign.start,
  bool readOnly = false,
  String obscuringCharacter = '•',
  bool obscureText = false,
  bool autocorrect = true,
  int? maxLength,
  ValueChanged<String>? onChanged,
  VoidCallback? onEditingComplete,
  ValueChanged<String>? onFieldSubmitted,
  FormFieldSetter<String>? onSaved,
  bool? enabled,
  EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  bool enableInteractiveSelection = true,
  AutovalidateMode? autovalidateMode,
  Key? key,
}) : this(
        validator: Pair.str(Int.max(max, large: large), validator ?? _dummy),
        malformed: malformed,
        blank: blank,
        trim: trim,
        controller: controller,
        initialValue: initialValue,
        decoration: decoration,
        textInputAction: textInputAction,
        style: style,
        textDirection: textDirection,
        textAlign: textAlign,
        readOnly: readOnly,
        obscuringCharacter: obscuringCharacter,
        obscureText: obscureText,
        autocorrect: autocorrect,
        maxLength: maxLength,
        onChanged: onChanged,
        onEditingComplete: onEditingComplete,
        onFieldSubmitted: onFieldSubmitted,
        onSaved: onSaved,
        enabled: enabled,
        scrollPadding: scrollPadding,
        enableInteractiveSelection: enableInteractiveSelection,
        autovalidateMode: autovalidateMode,
        key: key,
      );