import 'package:hub/features/backend/index.dart';
import 'package:hub/shared/utils/validator_util.dart';

import '/flutter_flow/flutter_flow_util.dart';
import 'forgot_password_template_component_widget.dart'
    show ForgotPasswordTemplateComponentWidget;
import 'package:flutter/material.dart';

class ForgotPasswordTemplateComponentModel
    extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
  ///  State fields for stateful widgets in this component.

  final formKey = GlobalKey<FormState>();
  // State field(s) for emailAddress widget.
  FocusNode? emailAddressFocusNode;
  TextEditingController? emailAddressTextController;
  String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
  String? _emailAddressTextControllerValidator(
      BuildContext context, String? val) {
    if (val == null || val.isEmpty) {
      return FFLocalizations.of(context).getText(
        'snnmkbyc' /* E-mail é Obrigatório */,
      );
    }

    if (!ValidatorUtil.isValidEmail(val)) {
      return FFLocalizations.of(context).getText(
        'jh5r2b1w' /* E-mail Inválido */,
      );
    }
    return null;
  }

  // Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget.
  ApiCallResponse? req;

  @override
  void initState(BuildContext context) {
    emailAddressTextControllerValidator = _emailAddressTextControllerValidator;
  }

  @override
  void dispose() {
    emailAddressFocusNode?.dispose();
    emailAddressTextController?.dispose();
  }
}
