import 'package:flutter/material.dart';

import '/flutter_flow/flutter_flow_util.dart';
import 'sign_in_template_component_widget.dart'
    show SignInTemplateComponentWidget;

class SignInTemplateComponentModel
    extends FlutterFlowModel<SignInTemplateComponentWidget> {
  final formKey = GlobalKey<FormState>();

  final unfocusNode = FocusNode();
  FocusNode? emailAddressFocusNode;
  TextEditingController? emailAddressTextController;
  String? Function(BuildContext, String?)? emailAddressTextControllerValidator;

  SignInTemplateComponentModel();

  String? _emailAddressTextControllerValidator(
      BuildContext context, String? val) {
    if (val == null || val.isEmpty) {
      return FFLocalizations.of(context).getText(
        'xhnawzcb' /* Campo é necessário */,
      );
    }

    if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) {
      return FFLocalizations.of(context).getText(
        's3j1hjqx' /* E-mail Inv */,
      );
    }
    return null;
  }

  FocusNode? passwordFocusNode;
  TextEditingController? passwordTextController;
  late bool passwordVisibility;
  String? Function(BuildContext, String?)? passwordTextControllerValidator;

  String? _passwordTextControllerValidator(BuildContext context, String? val) {
    if (val == null || val.isEmpty) {
      return FFLocalizations.of(context).getText(
        '9cs5wlmc' /* Campo é necessário */,
      );
    }

    return null;
  }

  @override
  void initState(BuildContext context) {
    emailAddressTextControllerValidator = _emailAddressTextControllerValidator;
    passwordVisibility = false;
    passwordTextControllerValidator = _passwordTextControllerValidator;
  }

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

    passwordFocusNode?.dispose();
    passwordTextController?.dispose();
  }
}
