ZetaTextInput constructor
- Key? key,
- ValueChanged<
String?> ? onChange, - bool disabled = false,
- ZetaFormFieldRequirement? requirementLevel = ZetaFormFieldRequirement.none,
- String? initialValue,
- AutovalidateMode? autovalidateMode,
- FormFieldValidator<
String> ? validator, - FormFieldSetter<
String> ? onSaved, - ValueChanged<
String?> ? onFieldSubmitted, - bool? rounded,
- String? label,
- String? hintText,
- String? placeholder,
- String? errorText,
- TextEditingController? controller,
- Widget? suffix,
- Widget? prefix,
- ZetaWidgetSize size = ZetaWidgetSize.medium,
- List<
TextInputFormatter> ? inputFormatters, - String? prefixText,
- TextStyle? prefixTextStyle,
- String? suffixText,
- TextStyle? suffixTextStyle,
- void onSubmit(
- String? val
- bool obscureText = false,
- TextInputType? keyboardType,
- FocusNode? focusNode,
- 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,
);
},
);