RegexTextField.password constructor

RegexTextField.password({
  1. Key? key,
  2. List<RegexModel>? rules,
  3. TextEditingController? controller,
  4. FocusNode? focusNode,
  5. TextInputAction? textInputAction,
  6. ValueChanged<bool>? validate,
  7. ValueChanged<String>? onSubmitted,
  8. bool optional = false,
  9. RegexUIVisibility visibility = RegexUIVisibility.focus,
  10. String? showLabel,
  11. String? hideLabel,
  12. String? label,
  13. int minLength = 8,
  14. RegexUIStyle style = RegexUIStyle.list,
  15. List<String>? strengthLabels,
})

A password field in one line: hidden text with a show / hide button, RegexModel.passwordRules and a real strength bar with labels. Pass rules to replace the default rules.

Implementation

RegexTextField.password({
  super.key,
  List<RegexModel>? rules,
  this.controller,
  this.focusNode,
  this.textInputAction,
  this.validate,
  this.onSubmitted,
  this.optional = false,
  this.visibility = RegexUIVisibility.focus,
  this.showLabel,
  this.hideLabel,
  String? label,
  int minLength = 8,
  this.style = RegexUIStyle.list,
  this.strengthLabels,
}) : rules = rules ?? RegexModel.passwordRules(minLength: minLength),
     decoration = InputDecoration(
       labelText: label ?? RegexLabels.current.passwordField,
     ),
     obscureText = true,
     keyboardType = TextInputType.visiblePassword,
     autofillHints = const [AutofillHints.password],
     showStrength = true,
     strengthMode = RegexUIStrength.password;