IntField.neg constructor Null safety

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

Constrains entered data to negative integers.

It sets the inputFormatters to deny non-digt characters except the minus '-' sign.

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. pos the error message in case a positive integer is entered.

Implementation

IntField.neg({
  bool trim = false,
  FormFieldValidator<String>? validator,
  String? blank,
  String? malformed,
  String? pos,
  String? initialValue,
  TextEditingController? controller,
  InputDecoration? decoration,
  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.neg(pos: pos), validator ?? _dummy),
        inputFormatters: [
          FilteringTextInputFormatter.allow(RegExp('[0-9-]')),
        ],
        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,
      );