ZetaTextInput constructor

ZetaTextInput({
  1. Key? key,
  2. ValueChanged<String?>? onChange,
  3. bool disabled = false,
  4. ZetaFormFieldRequirement? requirementLevel = ZetaFormFieldRequirement.none,
  5. String? initialValue,
  6. AutovalidateMode? autovalidateMode,
  7. FormFieldValidator<String>? validator,
  8. FormFieldSetter<String>? onSaved,
  9. ValueChanged<String?>? onFieldSubmitted,
  10. bool? rounded,
  11. String? label,
  12. String? hintText,
  13. String? placeholder,
  14. String? errorText,
  15. TextEditingController? controller,
  16. Widget? suffix,
  17. Widget? prefix,
  18. ZetaWidgetSize size = ZetaWidgetSize.medium,
  19. List<TextInputFormatter>? inputFormatters,
  20. String? prefixText,
  21. TextStyle? prefixTextStyle,
  22. String? suffixText,
  23. TextStyle? suffixTextStyle,
  24. void onSubmit(
    1. String? val
    )?,
  25. bool obscureText = false,
  26. TextInputType? keyboardType,
  27. FocusNode? focusNode,
  28. String? semanticLabel,
})

Creates a new ZetaTextInput

Implementation

ZetaTextInput({
  super.key,
  super.onChange,
  super.disabled = false,
  super.requirementLevel = ZetaFormFieldRequirement.none,
  super.initialValue,
  super.autovalidateMode,
  super.validator,
  super.onSaved,
  super.onFieldSubmitted,
  bool? rounded,
  this.label,
  this.hintText,
  this.placeholder,
  this.errorText,
  super.controller,
  this.suffix,
  this.prefix,
  this.size = ZetaWidgetSize.medium,
  this.inputFormatters,
  this.prefixText,
  this.prefixTextStyle,
  this.suffixText,
  this.suffixTextStyle,
  this.onSubmit,
  this.obscureText = false,
  this.keyboardType,
  this.focusNode,
  this.semanticLabel,
})  : assert(initialValue == null || controller == null, 'Only one of initial value and controller can be accepted.'),
      assert(prefix == null || prefixText == null, 'Only one of prefix or prefixText can be accepted.'),
      assert(suffix == null || suffixText == null, 'Only one of suffix or suffixText can be accepted.'),
      super(
        builder: (field) {
          final ZetaTextFormFieldState state = field as ZetaTextFormFieldState;

          return InternalTextInput(
            label: label,
            rounded: rounded,
            hintText: hintText,
            placeholder: placeholder,
            errorText: field.errorText ?? errorText,
            controller: state.effectiveController,
            suffix: suffix,
            suffixText: suffixText,
            suffixTextStyle: suffixTextStyle,
            prefix: prefix,
            prefixText: prefixText,
            prefixTextStyle: prefixTextStyle,
            size: size,
            onChange: state.onChange,
            onSubmit: onSubmit,
            inputFormatters: inputFormatters,
            obscureText: obscureText,
            keyboardType: keyboardType,
            focusNode: focusNode,
            semanticLabel: semanticLabel,
          );
        },
      );