CustomTextField constructor

const CustomTextField({
  1. bool? enabled,
  2. bool? obscureText,
  3. Key? formFieldKey,
  4. FocusNode? focusNode,
  5. String? fieldLabel,
  6. TextEditingController? controller,
  7. OnChangedString? onChanged,
  8. String? hintText,
  9. Color? hintColor,
  10. OnChangedString? onSubmitted,
  11. Color? customFillColor,
  12. int? maxLines,
  13. String? labelText,
  14. Widget? suffixIcon,
  15. Widget? prefixIcon,
  16. Color? borderColor,
  17. TextInputType? keyboardType,
  18. FormFieldValidator<String>? validator,
  19. List<TextInputFormatter>? inputFormatters,
  20. int? maxLength,
  21. bool? isRequired,
  22. AutovalidateMode? autovalidateMode,
  23. TextStyle? labelStyle,
  24. Color? focusedBorderColor,
  25. String? initialValue,
})

A wrapper for TextFormField that contains options for a field label.

For the label to appear the fieldLabel must be specified. If fieldLabel is specified and isRequired is true, then a red asterisk is added to the label.

For a documentation about the various parameters, see TextFormField.

Implementation

const CustomTextField({
  bool? enabled,
  bool? obscureText,
  this.formFieldKey,
  this.focusNode,
  this.fieldLabel,
  this.controller,
  this.onChanged,
  this.hintText,
  this.hintColor,
  this.onSubmitted,
  this.customFillColor,
  this.maxLines,
  this.labelText,
  this.suffixIcon,
  this.prefixIcon,
  this.borderColor,
  this.keyboardType,
  this.validator,
  this.inputFormatters,
  this.maxLength,
  this.isRequired,
  this.autovalidateMode,
  this.labelStyle,
  this.focusedBorderColor,
  this.initialValue,
})  : enabled = enabled ?? true,
      obscureText = obscureText ?? false;