UIProTextField.email constructor

const UIProTextField.email({
  1. Key? key,
  2. TextEditingController? controller,
  3. String? hint = "Email",
  4. String? label,
  5. String? errorText,
  6. String? helperText,
  7. IconData? prefixIcon = Icons.email_outlined,
  8. Widget? prefix,
  9. IconData? suffixIcon,
  10. Widget? suffix,
  11. TextInputAction? textInputAction,
  12. bool enabled = true,
  13. bool readOnly = false,
  14. bool autofocus = false,
  15. int? maxLength,
  16. List<TextInputFormatter>? inputFormatters,
  17. ValueChanged<String>? onChanged,
  18. VoidCallback? onEditingComplete,
  19. ValueChanged<String>? onSubmitted,
  20. VoidCallback? onTap,
  21. FocusNode? focusNode,
  22. double? borderRadius,
  23. Color? backgroundColor,
  24. Color? borderColor,
  25. Color? focusedBorderColor,
  26. Color? errorBorderColor,
  27. EdgeInsets? contentPadding,
  28. TextStyle? textStyle,
  29. TextStyle? hintStyle,
  30. TextStyle? labelStyle,
  31. TextStyle? errorStyle,
  32. bool showCounter = false,
  33. double? borderWidth,
  34. bool animateFocus = true,
  35. UIProTextFieldVariant variant = UIProTextFieldVariant.outlined,
  36. bool validateNotEmpty = false,
  37. String emptyErrorMessage = "Email is required",
  38. String invalidEmailMessage = "Please enter a valid email",
})

Creates an email text field with built-in email validation.

Implementation

const UIProTextField.email({
  super.key,
  this.controller,
  this.hint = "Email",
  this.label,
  this.errorText,
  this.helperText,
  this.prefixIcon = Icons.email_outlined,
  this.prefix,
  this.suffixIcon,
  this.suffix,
  this.textInputAction,
  this.enabled = true,
  this.readOnly = false,
  this.autofocus = false,
  this.maxLength,
  this.inputFormatters,
  this.onChanged,
  this.onEditingComplete,
  this.onSubmitted,
  this.onTap,
  this.focusNode,
  this.borderRadius,
  this.backgroundColor,
  this.borderColor,
  this.focusedBorderColor,
  this.errorBorderColor,
  this.contentPadding,
  this.textStyle,
  this.hintStyle,
  this.labelStyle,
  this.errorStyle,
  this.showCounter = false,
  this.borderWidth,
  this.animateFocus = true,
  this.variant = UIProTextFieldVariant.outlined,
  this.validateNotEmpty = false,
  this.emptyErrorMessage = "Email is required",
  this.invalidEmailMessage = "Please enter a valid email",
}) : isPassword = false,
     keyboardType = TextInputType.emailAddress,
     textCapitalization = TextCapitalization.none,
     obscuringCharacter = '•',
     maxLines = 1,
     minLines = null,
     fieldType = UIProTextFieldType.email,
     minPasswordLength = 6,
     shortPasswordMessage = "Password must be at least 6 characters";