import '/flutter_flow/flutter_flow_util.dart';
import 'change_pass_widget.dart' show PassKeyTemplateWidget;
import 'package:flutter/material.dart';

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

  final formKey = GlobalKey<FormState>();
  // State field(s) for keyTextField widget.
  FocusNode? keyTextFieldFocusNode1;
  FocusNode? keyTextFieldFocusNode2;
  TextEditingController? keyTextFieldTextController1;
  TextEditingController? keyTextFieldTextController2;
  late bool keyTextFieldVisibility1;
  late bool keyTextFieldVisibility2;
  String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator1;
  String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator2;
  String? _keyTextFieldTextControllerValidator(
      BuildContext context, String? val) {
    if (val == null || val.isEmpty) {
      return FFLocalizations.of(context).getVariableText(
        enText: 'This field is required',
        ptText: 'Este campo é obrigatório',
      );
    }
    if (val.length < 4) {
      return FFLocalizations.of(context).getVariableText(
        enText: 'This field must have at least 4 characters',
        ptText: 'Este campo deve ter pelo menos 4 caracteres',
      );
    }
    return null;
  }

  @override
  void initState(BuildContext context) {
    keyTextFieldVisibility1 = false;
    keyTextFieldVisibility2 = false;
    keyTextFieldTextControllerValidator1 = _keyTextFieldTextControllerValidator;
    keyTextFieldTextControllerValidator2 = _keyTextFieldTextControllerValidator;
  }

  @override
  void dispose() {
    keyTextFieldFocusNode1?.dispose();
    keyTextFieldFocusNode2?.dispose();
    keyTextFieldTextController1?.dispose();
    keyTextFieldTextController2?.dispose();
  }
}
