UppercaseField constructor

UppercaseField({
  1. String? labelPrefix,
  2. String? label,
  3. Widget? labelWidget,
  4. TextEditingController? controller,
  5. TextInputType keyboard = TextInputType.text,
  6. FormFieldValidator<String>? validator,
  7. int minLines = 1,
  8. int maxLines = 1,
  9. bool obscureText = false,
  10. List<TextInputFormatter>? inputFormatter,
  11. TextAlign textAlign = TextAlign.start,
  12. int? maxLength,
  13. FormFieldSetter<String>? onSaved,
  14. String? initialValue,
  15. bool enabled = true,
  16. AutovalidateMode autoValidateMode = AutovalidateMode.disabled,
  17. ValueChanged<String?>? onChanged,
  18. FocusNode? focusNode,
  19. TextInputAction? textInputAction,
  20. ValueChanged<String?>? onFieldSubmitted,
  21. bool autocorrect = true,
  22. bool enableSuggestions = true,
  23. TextCapitalization textCapitalization = TextCapitalization.none,
  24. EdgeInsets scrollPadding = const EdgeInsets.all(20),
  25. bool enableInteractiveSelection = true,
  26. bool readOnly = false,
  27. TextStyle? style,
  28. InputDecoration? decoration,
  29. EdgeInsets padding = const EdgeInsets.all(8),
  30. String? hintText,
  31. EdgeInsets? contentPadding,
  32. String? counterText = '',
  33. Widget? prefix,
  34. Widget? prefixIcon,
  35. Widget? suffix,
  36. Widget? suffixIcon,
  37. bool trimOnSaved = true,
  38. bool emptyIsNull = true,
  39. VoidCallback? onTap,
  40. Iterable<String>? autofillHints,
  41. int? sizeExtraSmall,
  42. int? sizeSmall,
  43. int? sizeMedium,
  44. int? sizeLarge,
  45. int? sizeExtraLarge,
  46. double? minHeight,
  47. Key? key,
})

Implementation

UppercaseField({
  super.labelPrefix,
  super.label,
  super.labelWidget,
  super.controller,
  super.keyboard,
  super.validator,
  super.minLines,
  super.maxLines,
  super.obscureText,
  List<TextInputFormatter>? inputFormatter,
  super.textAlign,
  super.maxLength,
  super.onSaved,
  super.initialValue,
  super.enabled,
  super.autoValidateMode,
  super.onChanged,
  super.focusNode,
  super.textInputAction,
  super.onFieldSubmitted,
  super.autocorrect,
  super.enableSuggestions,
  super.textCapitalization,
  super.scrollPadding,
  super.enableInteractiveSelection,
  super.readOnly,
  super.style,
  super.decoration,
  super.padding,
  super.hintText,
  super.contentPadding,
  super.counterText,
  super.prefix,
  super.prefixIcon,
  super.suffix,
  super.suffixIcon,
  super.trimOnSaved,
  super.emptyIsNull,
  super.onTap,
  super.autofillHints,
  super.sizeExtraSmall,
  super.sizeSmall,
  super.sizeMedium,
  super.sizeLarge,
  super.sizeExtraLarge,
  super.minHeight,
  super.key,
}) : assert(
       initialValue == null || controller == null,
       'initialValue or controller must be null.',
     ),
     assert(
       label == null || labelWidget == null,
       'label or labelWidget must be null.',
     ),
     super(
       inputFormatter: <TextInputFormatter>[
         TextInputFormatter.withFunction(
           (TextEditingValue oldValue, TextEditingValue newValue) =>
               newValue.copyWith(text: newValue.text.toUpperCase()),
         ),
         ...inputFormatter ?? <TextInputFormatter>[],
       ],
     );