FormEmailField constructor

FormEmailField({
  1. Key? key,
  2. EdgeInsets? padding,
  3. String? errorText,
  4. String? labelText,
  5. String? hintText,
  6. FocusNode? focusNode,
  7. Widget? prefixIcon,
  8. String? initialValue,
  9. ValueChanged<String>? onChanged,
  10. FormFieldValidator<String>? validator,
  11. ValueChanged<String>? onSubmitted,
  12. InputBorder? border,
})

Implementation

FormEmailField(
    {Key? key,
    EdgeInsets? padding,
    String? errorText,
    String? labelText,
    String? hintText,
    FocusNode? focusNode,
    Widget? prefixIcon,
    String? initialValue,
    ValueChanged<String>? onChanged,
    FormFieldValidator<String>? validator,
    ValueChanged<String>? onSubmitted,
    InputBorder? border})
    : super(
          key: UniqueKey(),
          builder: (FormFieldState<String> field) {
            return TextFormField(
              key: key,
              autofocus: true,
              initialValue: initialValue,
              keyboardType: TextInputType.emailAddress,
              autofillHints: const [AutofillHints.email],
              onFieldSubmitted: onSubmitted,
              onChanged: onChanged,
              focusNode: focusNode,
              validator: validator ?? defaultEmailValidattor(errorText),
              decoration: InputDecoration(
                border: border ?? const OutlineInputBorder(),
                prefixIcon: prefixIcon ?? const Icon(Icons.markunread_outlined),
                labelText: labelText ?? 'Email',
                hintText: hintText ?? 'Enter valid email',
              ),
            );
          });