BasicTextField.max constructor

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

Text form field whose number of characters (length) must be at most max characters.

max the maximum length of the input data; it must be > 0. long the error message if the length of the input data is longer than max. trim whether to trim or not the input data. blank the error message in case of blank field; if omitted, the field will not be made required. validator an optional extra validation step.

Implementation

BasicTextField.max(
  int max, {
  String? long,
  bool trim = false,
  String? blank,
  TextEditingController? controller,
  String? initialValue,
  InputDecoration? decoration = const InputDecoration(),
  TextInputAction? textInputAction,
  TextStyle? style,
  TextDirection? textDirection,
  TextAlign textAlign = TextAlign.start,
  bool readOnly = false,
  bool obscureText = false,
  bool autocorrect = true,
  String obscuringCharacter = '•',
  int? maxLength,
  TextInputType? keyboardType,
  ValueChanged<String>? onChanged,
  VoidCallback? onEditingComplete,
  ValueChanged<String>? onFieldSubmitted,
  FormFieldSetter<String>? onSaved,
  FormFieldValidator<String>? validator,
  List<TextInputFormatter>? inputFormatters,
  bool? enabled,
  EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  bool enableInteractiveSelection = true,
  AutovalidateMode? autovalidateMode,
  Key? key,
}) : this(
        validator: Pair.str2(Len.max(max, long: long), validator ?? _ok),
        trim: trim,
        blank: blank,
        controller: controller,
        initialValue: initialValue,
        decoration: decoration,
        keyboardType: keyboardType,
        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,
        inputFormatters: inputFormatters,
        enabled: enabled,
        scrollPadding: scrollPadding,
        enableInteractiveSelection: enableInteractiveSelection,
        autovalidateMode: autovalidateMode,
        key: key,
      );