UIProTextField.password constructor

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

Creates a password text field with visibility toggle.

Implementation

const UIProTextField.password({
  super.key,
  this.controller,
  this.hint = "Password",
  this.label,
  this.errorText,
  this.helperText,
  this.prefixIcon = Icons.lock_outline,
  this.prefix,
  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.obscuringCharacter = '•',
  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 = "Password is required",
  this.minPasswordLength = 6,
  this.shortPasswordMessage = "Password must be at least 6 characters",
})  : isPassword = true,
      keyboardType = TextInputType.visiblePassword,
      textCapitalization = TextCapitalization.none,
      maxLines = 1,
      minLines = null,
      suffixIcon = null,
      suffix = null,
      fieldType = UIProTextFieldType.password,
      invalidEmailMessage = "Please enter a valid email";