ZetaPasswordInput constructor

ZetaPasswordInput({
  1. Key? key,
  2. bool? rounded,
  3. String? initialValue,
  4. AutovalidateMode? autovalidateMode,
  5. ZetaFormFieldRequirement? requirementLevel = ZetaFormFieldRequirement.none,
  6. ValueChanged<String?>? onChange,
  7. FormFieldSetter<String>? onSaved,
  8. ValueChanged<String?>? onFieldSubmitted,
  9. bool disabled = false,
  10. ZetaWidgetSize size = ZetaWidgetSize.medium,
  11. FormFieldValidator<String>? validator,
  12. void onSubmit(
    1. String? val
    )?,
  13. @Deprecated('Use disabled instead. ' 'This property has been renamed as of 0.11.2') bool enabled = true,
  14. TextEditingController? controller,
  15. String? hintText,
  16. String? errorText,
  17. String? label,
  18. String? placeholder,
  19. String? semanticLabel,
  20. String? obscureSemanticLabel,
  21. String? showSemanticLabel,
})

Constructs ZetaPasswordInput

Implementation

ZetaPasswordInput({
  super.key,
  bool? rounded,
  super.initialValue,
  super.autovalidateMode,
  super.requirementLevel = ZetaFormFieldRequirement.none,
  super.onChange,
  super.onSaved,
  super.onFieldSubmitted,
  super.disabled = false,
  this.size = ZetaWidgetSize.medium,
  super.validator,
  this.onSubmit,
  @Deprecated('Use disabled instead. ' 'This property has been renamed as of 0.11.2') bool enabled = true,
  super.controller,
  this.hintText,
  this.errorText,
  this.label,
  this.placeholder,
  this.semanticLabel,
  this.obscureSemanticLabel,
  this.showSemanticLabel,
}) : super(
        builder: (field) {
          final _ZetaPasswordInputState state = field as _ZetaPasswordInputState;

          return InternalTextInput(
            size: size,
            rounded: rounded,
            controller: state.effectiveController,
            hintText: hintText,
            placeholder: placeholder,
            label: label,
            onChange: state.didChange,
            requirementLevel: requirementLevel,
            errorText: field.errorText ?? errorText,
            onSubmit: onSubmit,
            constrained: true,
            disabled: disabled,
            obscureText: state._obscureText,
            semanticLabel: semanticLabel,
            suffix: MergeSemantics(
              child: Semantics(
                label: state._obscureText ? showSemanticLabel : obscureSemanticLabel,
                child: IconButton(
                  icon: ZetaIcon(state._obscureText ? ZetaIcons.visibility_off : ZetaIcons.visibility),
                  onPressed: state.toggleVisibility,
                ),
              ),
            ),
          );
        },
      );