import '/flutter_flow/flutter_flow_util.dart';
import 'qr_code_pass_key_template_component_widget.dart'
    show QrCodePassKeyTemplateComponentWidget;
import 'package:flutter/material.dart';

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

  final formKey = GlobalKey<FormState>();
  // State field(s) for keyTextField widget.
  FocusNode? keyTextFieldFocusNode;
  TextEditingController? keyTextFieldTextController;
  late bool keyTextFieldVisibility;
  String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator;
  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 be at least 4 characters',
        ptText: 'Este campo deve ter pelo menos 4 caracteres',
      );
    }

    return null;
  }

  @override
  void initState(BuildContext context) {
    keyTextFieldVisibility = false;
    keyTextFieldTextControllerValidator = _keyTextFieldTextControllerValidator;
  }

  @override
  void dispose() {
    keyTextFieldFocusNode?.dispose();
    keyTextFieldTextController?.dispose();
  }
}
