From 03bd74705025a9c052d628522fb14c729daf9a8a Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 2 Aug 2024 12:15:15 -0300 Subject: [PATCH] WIP --- ...regisiter_vistor_template_component_widget.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 1f06484d..5ea36575 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -74,20 +74,23 @@ class _RegisiterVistorTemplateComponentWidgetState } bool _isFormValid(BuildContext context) { - if (_model.uploadedLocalFile.bytes?.isEmpty ?? true) { return false; } - if (_model.textController1.text.isEmpty || _model.textController1.text == '') { + if (_model.textController1.text.isEmpty || + _model.textController1.text == '') { return false; } - if (_model.dropDownValue == null || _model.dropDownValue!.isEmpty || _model.dropDownValue == '') { + if (_model.dropDownValue == null || + _model.dropDownValue!.isEmpty || + _model.dropDownValue == '') { return false; } - if (_model.textController2.text.isEmpty || _model.textController2.text == '') { + if (_model.textController2.text.isEmpty || + _model.textController2.text == '') { return false; } @@ -244,11 +247,12 @@ class _RegisiterVistorTemplateComponentWidgetState } else if (snapshot.hasError || snapshot.data == null || snapshot.data == '') { + safeSetState(() => _isVisitorRegistered = false); _isVisitorRegistered = false; visitorAlreadyRegistered.add(true); return const SizedBox(); } else { - _isVisitorRegistered = true; + safeSetState(() => _isVisitorRegistered = true); visitorAlreadyRegistered.add(false); return _model.textController2.text.isEmpty ? const SizedBox()