Merge branch 'main' into bugfix/fd-645
This commit is contained in:
commit
bb66e77beb
|
@ -4,6 +4,7 @@ import 'dart:developer';
|
|||
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||
import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/shared/utils/validator_util.dart';
|
||||
|
||||
import '/backend/api_requests/api_calls.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
|
@ -12,15 +13,13 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'regisiter_vistor_template_component_widget.dart';
|
||||
|
||||
class RegisiterVistorTemplateComponentModel
|
||||
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||
class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||
/// State fields for stateful widgets in this page.
|
||||
Timer? _debounceTimer;
|
||||
|
||||
final unfocusNode = FocusNode();
|
||||
bool isDataUploading = false;
|
||||
FFUploadedFile uploadedLocalFile =
|
||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
|
||||
void debounce(Function() fn, Duration time) {
|
||||
if (_debounceTimer != null) {
|
||||
|
@ -98,13 +97,7 @@ class RegisiterVistorTemplateComponentModel
|
|||
TextEditingController? textController4;
|
||||
String? Function(BuildContext, String?)? textController4Validator;
|
||||
String? _textController4Validator(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.contains('@') || !val.contains('.')) {
|
||||
if (val != null && val.isNotEmpty && ValidatorUtil.isValidEmail(val) == false) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Invalid email',
|
||||
ptText: 'Email inválido',
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'dart:developer';
|
|||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/validator_util.dart';
|
||||
import 'package:json_path/fun_sdk.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
|
||||
|
@ -87,19 +88,15 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -107,6 +104,10 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
return false;
|
||||
}
|
||||
|
||||
if (_model.textController4.text.isNotEmpty && _model.textController4.text != '' && ValidatorUtil.isValidEmail(_model.textController4.text) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -129,7 +130,6 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Form(
|
||||
// key: UniqueKey(),
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -138,8 +138,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
20.0, 30.0, 0.0, 15.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 15.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'zazj5d8b' /* Preencha o formulário com os d... */,
|
||||
|
@ -368,8 +367,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator:
|
||||
_model.textController1Validator.asValidator(context),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
|
@ -455,7 +453,9 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
],
|
||||
),
|
||||
),
|
||||
Builder(
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) {
|
||||
return InkWell(
|
||||
|
@ -485,7 +485,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
return Stack(
|
||||
children: [
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(0.01, 0.0),
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () async {
|
||||
final selectedMedia =
|
||||
|
@ -549,10 +549,9 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
size: 30.0,
|
||||
),
|
||||
options: FFButtonOptions(
|
||||
width: 300.0,
|
||||
height: 80.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 0.0, 0.0, 0.0),
|
||||
width: double.infinity,
|
||||
height: 120.0,
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0),
|
||||
iconPadding:
|
||||
const EdgeInsetsDirectional.fromSTEB(
|
||||
14.0, 0.0, 0.0, 20.0),
|
||||
|
@ -584,7 +583,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0.0, 50.0, 0.0, 0.0),
|
||||
10.0, 65.0, 10.0, 0.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'p4ftwxcy' /* Clique para adicionar a foto p... */,
|
||||
|
@ -610,6 +609,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
|
@ -792,13 +792,11 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
// validator:
|
||||
// _model.textController4Validator.asValidator(context),
|
||||
validator: _model.textController4Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: _isFormValid(context)
|
||||
? () async {
|
||||
|
|
Loading…
Reference in New Issue