fix message well, visitor register and preferences pages
This commit is contained in:
parent
ee8591f41d
commit
14d2c2f19e
|
@ -15,7 +15,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
class ScheduleVisitDetailWidget extends StatefulWidget {
|
class ScheduleVisitDetailWidget extends StatefulWidget {
|
||||||
const ScheduleVisitDetailWidget({
|
const ScheduleVisitDetailWidget({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -59,24 +58,22 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => ScheduleVisitDetailModel());
|
_model = createModel(context, () => ScheduleVisitDetailModel());
|
||||||
|
|
||||||
_model.textController1 ??=
|
_model.textController1 ??= TextEditingController(text: widget.visitTempStr);
|
||||||
TextEditingController(text: widget.visitTempStr);
|
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController2 ??=
|
_model.textController2 ??=
|
||||||
TextEditingController(text: widget.visitStartDate);
|
TextEditingController(text: widget.visitStartDate);
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
_model.textFieldFocusNode2 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController3 ??=
|
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
||||||
TextEditingController(text: widget.visitEndDate);
|
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController4 ??= TextEditingController(
|
_model.textController4 ??=
|
||||||
text: extractDescToStr(widget.visitResonStr!));
|
TextEditingController(text: extractDescToStr(widget.visitResonStr!));
|
||||||
_model.textFieldFocusNode4 ??= FocusNode();
|
_model.textFieldFocusNode4 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController5 ??= TextEditingController(
|
_model.textController5 ??=
|
||||||
text: extractDescToStr(widget.visitLevelStr!));
|
TextEditingController(text: extractDescToStr(widget.visitLevelStr!));
|
||||||
_model.textFieldFocusNode5 ??= FocusNode();
|
_model.textFieldFocusNode5 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
||||||
|
@ -132,8 +129,8 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
15.0, 0.0, 0.0, 0.0),
|
||||||
child: FlutterFlowIconButton(
|
child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
|
@ -192,41 +189,47 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
BorderRadius.circular(100.0),
|
BorderRadius.circular(100.0),
|
||||||
),
|
),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(
|
||||||
const AlignmentDirectional(1.0, -1.0),
|
1.0, -1.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
Navigator.pop(context);
|
// Navigator.pop(context);
|
||||||
await showModalBottomSheet(
|
// await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
backgroundColor:
|
// backgroundColor:
|
||||||
Colors.transparent,
|
// Colors.transparent,
|
||||||
useSafeArea: true,
|
// useSafeArea: true,
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (context) {
|
// builder: (context) {
|
||||||
return Padding(
|
// return Padding(
|
||||||
padding:
|
// padding:
|
||||||
MediaQuery.viewInsetsOf(
|
// MediaQuery.viewInsetsOf(
|
||||||
context),
|
// context),
|
||||||
child:
|
// child:
|
||||||
const VisitorDetailsModalTemplateComponentWidget(),
|
// VisitorDetailsModalTemplateComponentWidget(
|
||||||
);
|
// visitorImageURL: '',
|
||||||
},
|
// visitorEmail: '',
|
||||||
).then((value) =>
|
// visitorName: '',
|
||||||
safeSetState(() {}));
|
// visitorPhone: '',
|
||||||
|
// visitorType: '',
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ).then((value) =>
|
||||||
|
// safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(100.0),
|
BorderRadius.circular(100.0),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration:
|
fadeInDuration: const Duration(
|
||||||
const Duration(milliseconds: 500),
|
milliseconds: 500),
|
||||||
fadeOutDuration:
|
fadeOutDuration: const Duration(
|
||||||
const Duration(milliseconds: 500),
|
milliseconds: 500),
|
||||||
imageUrl:
|
imageUrl:
|
||||||
valueOrDefault<String>(
|
valueOrDefault<String>(
|
||||||
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||||
|
@ -352,8 +355,9 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding:
|
||||||
8.0, 0.0, 8.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
8.0, 0.0, 8.0, 0.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController2,
|
controller: _model.textController2,
|
||||||
focusNode: _model.textFieldFocusNode2,
|
focusNode: _model.textFieldFocusNode2,
|
||||||
|
@ -459,8 +463,9 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding:
|
||||||
8.0, 0.0, 8.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
8.0, 0.0, 8.0, 0.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController3,
|
controller: _model.textController3,
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
|
@ -576,8 +581,9 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding:
|
||||||
8.0, 0.0, 8.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
8.0, 0.0, 8.0, 0.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController4,
|
controller: _model.textController4,
|
||||||
focusNode: _model.textFieldFocusNode4,
|
focusNode: _model.textFieldFocusNode4,
|
||||||
|
@ -683,8 +689,9 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding:
|
||||||
8.0, 0.0, 8.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
8.0, 0.0, 8.0, 0.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController5,
|
controller: _model.textController5,
|
||||||
focusNode: _model.textFieldFocusNode5,
|
focusNode: _model.textFieldFocusNode5,
|
||||||
|
@ -905,7 +912,8 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 35.0,
|
height: 35.0,
|
||||||
|
@ -934,8 +942,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
dtInicio: widget.visitStartDate,
|
dtInicio: widget.visitStartDate,
|
||||||
dtFim: widget.visitEndDate,
|
dtFim: widget.visitEndDate,
|
||||||
unica: widget.visitTempStr,
|
unica: widget.visitTempStr,
|
||||||
idMotivo:
|
idMotivo: extractIdToStr(widget.visitResonStr!),
|
||||||
extractIdToStr(widget.visitResonStr!),
|
|
||||||
idNAC: extractIdToStr(widget.visitLevelStr!),
|
idNAC: extractIdToStr(widget.visitLevelStr!),
|
||||||
obs: widget.visitObsStr,
|
obs: widget.visitObsStr,
|
||||||
cliID: FFAppState().cliUUID,
|
cliID: FFAppState().cliUUID,
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
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 '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/form_field_controller.dart';
|
import '/flutter_flow/form_field_controller.dart';
|
||||||
|
@ -25,6 +31,24 @@ class RegisiterVistorTemplateComponentModel
|
||||||
ptText: 'Este campo é obrigatório',
|
ptText: 'Este campo é obrigatório',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool?> getVisitanteByDocument(
|
||||||
|
String document, BuildContext context) async {
|
||||||
|
final response = await PhpGroup.getVisitorByDocCall.call(
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
atividade: 'getVisitante',
|
||||||
|
documento: document,
|
||||||
|
);
|
||||||
|
log('${response.jsonBody}');
|
||||||
|
if (response.jsonBody['visitante']['VTE_ID'] != '0' &&
|
||||||
|
response.jsonBody['error'] != 'false') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
import 'package:json_path/fun_sdk.dart';
|
||||||
|
import 'package:rxdart/rxdart.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
|
@ -15,6 +18,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'regisiter_vistor_template_component_model.dart';
|
import 'regisiter_vistor_template_component_model.dart';
|
||||||
|
|
||||||
export 'regisiter_vistor_template_component_model.dart';
|
export 'regisiter_vistor_template_component_model.dart';
|
||||||
|
|
||||||
class RegisiterVistorTemplateComponentWidget extends StatefulWidget {
|
class RegisiterVistorTemplateComponentWidget extends StatefulWidget {
|
||||||
|
@ -45,6 +49,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
|
|
||||||
_model.textController2 ??= TextEditingController();
|
_model.textController2 ??= TextEditingController();
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
_model.textFieldFocusNode2 ??= FocusNode();
|
||||||
|
_model.textController2?.addListener(_onTextChanged);
|
||||||
|
|
||||||
_model.textController3 ??= TextEditingController();
|
_model.textController3 ??= TextEditingController();
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
|
@ -58,10 +63,17 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
_model.dispose();
|
_model.dispose();
|
||||||
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
_model.textController2?.removeListener(_onTextChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onTextChanged() {
|
||||||
|
log('changed');
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>();
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
log(context
|
log(context
|
||||||
.describeWidget('RegisiterVistorTemplateComponentWidget')
|
.describeWidget('RegisiterVistorTemplateComponentWidget')
|
||||||
|
@ -83,11 +95,360 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Form(
|
child: Form(
|
||||||
// key: UniqueKey(),
|
// key: UniqueKey(),
|
||||||
autovalidateMode: AutovalidateMode.disabled,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
20.0, 30.0, 0.0, 15.0),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'zazj5d8b' /* Preencha o formulário com os d... */,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
24.0, 0.0, 24.0, 0.0),
|
||||||
|
child: TextFormField(
|
||||||
|
controller: _model.textController2,
|
||||||
|
focusNode: _model.textFieldFocusNode2,
|
||||||
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
|
autofocus: false,
|
||||||
|
textCapitalization: TextCapitalization.none,
|
||||||
|
autofillHints: const [AutofillHints.password],
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
obscureText: false,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
|
labelText: FFLocalizations.of(context).getText(
|
||||||
|
'rl8tvwnr' /* Documento */,
|
||||||
|
),
|
||||||
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
|
),
|
||||||
|
hintStyle: FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).error,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).error,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
suffixIcon: Icon(
|
||||||
|
Icons.document_scanner,
|
||||||
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
|
),
|
||||||
|
validator:
|
||||||
|
_model.textController2Validator.asValidator(context),
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FutureBuilder(
|
||||||
|
future: _model.textController2.text.isNotEmpty
|
||||||
|
? _model.getVisitanteByDocument(
|
||||||
|
_model.textController2.text, context)
|
||||||
|
: null,
|
||||||
|
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
return const SizedBox();
|
||||||
|
} else if (snapshot.hasError ||
|
||||||
|
snapshot.data == null ||
|
||||||
|
snapshot.data == '') {
|
||||||
|
visitorAlreadyRegistered.add(true);
|
||||||
|
return const SizedBox();
|
||||||
|
} else {
|
||||||
|
visitorAlreadyRegistered.add(false);
|
||||||
|
return _model.textController2.text.isEmpty
|
||||||
|
? const SizedBox()
|
||||||
|
: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
right: MediaQuery.sizeOf(context).width *
|
||||||
|
0.1),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context)
|
||||||
|
.getVariableText(
|
||||||
|
enText: 'Visitor already registered',
|
||||||
|
ptText: 'Visitante já cadastrado',
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodySmall
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Nunito',
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.error,
|
||||||
|
fontSize: 14.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
24.0, 0.0, 24.0, 0.0),
|
||||||
|
child: TextFormField(
|
||||||
|
controller: _model.textController1,
|
||||||
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
|
focusNode: _model.textFieldFocusNode1,
|
||||||
|
autofocus: false,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
obscureText: false,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
|
labelText: FFLocalizations.of(context).getText(
|
||||||
|
'v7g73yik' /* Nome */,
|
||||||
|
),
|
||||||
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
|
),
|
||||||
|
hintStyle: FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).error,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).error,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
suffixIcon: Icon(
|
||||||
|
Icons.person,
|
||||||
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
|
),
|
||||||
|
maxLines: null,
|
||||||
|
keyboardType: TextInputType.name,
|
||||||
|
validator:
|
||||||
|
_model.textController1Validator.asValidator(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.sizeOf(context).width * 0.95,
|
||||||
|
decoration: const BoxDecoration(),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0.0, 0.0, 0.0, 7.0),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'yp23q90m' /* Selecione o tipo: */,
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
.containsKey(
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0.0, 0.0, 0.0, 5.0),
|
||||||
|
child: FlutterFlowDropDown<String>(
|
||||||
|
controller: _model.dropDownValueController ??=
|
||||||
|
FormFieldController<String>(null),
|
||||||
|
options: [
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'n8vddmcq' /* Visitante */,
|
||||||
|
),
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'9luaa09e' /* Prestador de Serviço */,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
onChanged: (val) =>
|
||||||
|
setState(() => _model.dropDownValue = val),
|
||||||
|
width: 200.0,
|
||||||
|
height: 44.0,
|
||||||
|
textStyle: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
.containsKey(
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
|
hintText: FFLocalizations.of(context).getText(
|
||||||
|
'pmezihb4' /* Selecione... */,
|
||||||
|
),
|
||||||
|
icon: Icon(
|
||||||
|
Icons.keyboard_arrow_down_rounded,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).primaryText,
|
||||||
|
size: 24.0,
|
||||||
|
),
|
||||||
|
elevation: 2.0,
|
||||||
|
borderColor:
|
||||||
|
FlutterFlowTheme.of(context).customColor6,
|
||||||
|
borderWidth: 0.5,
|
||||||
|
borderRadius: 8.0,
|
||||||
|
margin: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
16.0, 0.0, 16.0, 0.0),
|
||||||
|
hidesUnderline: true,
|
||||||
|
isOverButton: true,
|
||||||
|
isSearchable: false,
|
||||||
|
isMultiSelect: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
.divide(const SizedBox(width: 19.0))
|
||||||
|
.addToStart(const SizedBox(width: 30.0)),
|
||||||
|
),
|
||||||
|
if (_model.dropDownValue == null ||
|
||||||
|
_model.dropDownValue == '')
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0.4, 0),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required',
|
||||||
|
ptText: 'Este campo é obrigatório',
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodySmall
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.bodySmallFamily,
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.customColor6,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
.containsKey(
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodySmallFamily),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
Builder(
|
Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) {
|
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) {
|
||||||
|
@ -246,310 +607,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
20.0, 30.0, 0.0, 15.0),
|
20.0, 10.0, 0.0, 15.0),
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'zazj5d8b' /* Preencha o formulário com os d... */,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.start,
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController1,
|
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
|
||||||
focusNode: _model.textFieldFocusNode1,
|
|
||||||
autofocus: false,
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'v7g73yik' /* Nome */,
|
|
||||||
),
|
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
suffixIcon: Icon(
|
|
||||||
Icons.person,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
|
||||||
maxLines: null,
|
|
||||||
keyboardType: TextInputType.name,
|
|
||||||
validator:
|
|
||||||
_model.textController1Validator.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController2,
|
|
||||||
focusNode: _model.textFieldFocusNode2,
|
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
|
||||||
autofocus: false,
|
|
||||||
textCapitalization: TextCapitalization.none,
|
|
||||||
autofillHints: const [AutofillHints.password],
|
|
||||||
keyboardType: TextInputType.number,
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'rl8tvwnr' /* Documento */,
|
|
||||||
),
|
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
suffixIcon: Icon(
|
|
||||||
Icons.document_scanner,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
|
||||||
validator:
|
|
||||||
_model.textController2Validator.asValidator(context),
|
|
||||||
inputFormatters: [
|
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
|
||||||
child: Container(
|
|
||||||
width: MediaQuery.sizeOf(context).width * 0.95,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 7.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'yp23q90m' /* Selecione o tipo: */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 5.0),
|
|
||||||
child: FlutterFlowDropDown<String>(
|
|
||||||
controller: _model.dropDownValueController ??=
|
|
||||||
FormFieldController<String>(null),
|
|
||||||
options: [
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'n8vddmcq' /* Visitante */,
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'9luaa09e' /* Prestador de Serviço */,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
onChanged: (val) =>
|
|
||||||
setState(() => _model.dropDownValue = val),
|
|
||||||
width: 200.0,
|
|
||||||
height: 44.0,
|
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'pmezihb4' /* Selecione... */,
|
|
||||||
),
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_down_rounded,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).primaryText,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
elevation: 2.0,
|
|
||||||
borderColor:
|
|
||||||
FlutterFlowTheme.of(context).customColor6,
|
|
||||||
borderWidth: 0.5,
|
|
||||||
borderRadius: 8.0,
|
|
||||||
margin: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
16.0, 0.0, 16.0, 0.0),
|
|
||||||
hidesUnderline: true,
|
|
||||||
isOverButton: true,
|
|
||||||
isSearchable: false,
|
|
||||||
isMultiSelect: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
.divide(const SizedBox(width: 19.0))
|
|
||||||
.addToStart(const SizedBox(width: 30.0)),
|
|
||||||
),
|
|
||||||
if (_model.dropDownValue == null ||
|
|
||||||
_model.dropDownValue == '')
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.4, 0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'This field is required',
|
|
||||||
ptText: 'Este campo é obrigatório',
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodySmall
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodySmallFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.customColor6,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodySmallFamily),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
20.0, 0.0, 0.0, 15.0),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'bqpucwh0' /* Contatos */,
|
'bqpucwh0' /* Contatos */,
|
||||||
|
@ -735,155 +793,129 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: () async {
|
onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ??
|
||||||
if (((_model.uploadedLocalFile.bytes?.isNotEmpty ??
|
false)) &&
|
||||||
false)) &&
|
(_model.textController1.text != '') &&
|
||||||
(_model.textController1.text != '') &&
|
(_model.dropDownValue != null &&
|
||||||
(_model.dropDownValue != null &&
|
_model.dropDownValue != '') &&
|
||||||
_model.dropDownValue != '') &&
|
(_model.textController2.text != ''))
|
||||||
(_model.textController2.text != '')) {
|
? () async {
|
||||||
_model.imgBase64 =
|
log(visitorAlreadyRegistered.value.toString());
|
||||||
await actions.convertImageFileToBase64(
|
if (visitorAlreadyRegistered.value == true) {
|
||||||
_model.uploadedLocalFile,
|
_model.imgBase64 =
|
||||||
);
|
await actions.convertImageFileToBase64(
|
||||||
_model.scheduleVisitor =
|
_model.uploadedLocalFile,
|
||||||
await PhpGroup.postScheduleVisitorCall
|
);
|
||||||
.call(
|
_model.scheduleVisitor =
|
||||||
devUUID: FFAppState().devUUID,
|
await PhpGroup.postScheduleVisitorCall
|
||||||
userUUID: FFAppState().userUUID,
|
.call(
|
||||||
cliID: FFAppState().cliUUID,
|
devUUID: FFAppState().devUUID,
|
||||||
atividade: 'putVisitante',
|
userUUID: FFAppState().userUUID,
|
||||||
documento: _model.textController2.text,
|
cliID: FFAppState().cliUUID,
|
||||||
nome: _model.textController1.text,
|
atividade: 'putVisitante',
|
||||||
tipo: _model.dropDownValue ==
|
documento: _model.textController2.text,
|
||||||
FFLocalizations.of(context).getText(
|
nome: _model.textController1.text,
|
||||||
'n8vddmcq' /* Visitante */,
|
tipo: _model.dropDownValue ==
|
||||||
)
|
FFLocalizations.of(context).getText(
|
||||||
? 'V'
|
'n8vddmcq' /* Visitante */,
|
||||||
: 'P',
|
)
|
||||||
foto: 'base64;jpeg,${_model.imgBase64}',
|
? 'V'
|
||||||
)
|
: 'P',
|
||||||
.onError((e, s) async {
|
foto: 'base64;jpeg,${_model.imgBase64}',
|
||||||
return await showAdaptiveDialog(
|
)
|
||||||
context: context,
|
.onError((e, s) async {
|
||||||
builder: (context) {
|
return await showAdaptiveDialog(
|
||||||
return GestureDetector(
|
context: context,
|
||||||
onTap: () => Navigator.pop(context),
|
builder: (context) {
|
||||||
child: Padding(
|
return GestureDetector(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
onTap: () => Navigator.pop(context),
|
||||||
child: Dialog(
|
child: Padding(
|
||||||
backgroundColor: Colors.transparent,
|
padding:
|
||||||
child: ThrowExceptionWidget(
|
MediaQuery.viewInsetsOf(context),
|
||||||
msg: FFLocalizations.of(context)
|
child: Dialog(
|
||||||
.getVariableText(
|
backgroundColor: Colors.transparent,
|
||||||
ptText:
|
child: ThrowExceptionWidget(
|
||||||
'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.',
|
msg: FFLocalizations.of(context)
|
||||||
enText:
|
.getVariableText(
|
||||||
'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.',
|
ptText:
|
||||||
|
'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.',
|
||||||
|
enText:
|
||||||
|
'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
if (PhpGroup.postScheduleVisitorCall.error(
|
||||||
|
(_model.scheduleVisitor?.jsonBody ?? ''),
|
||||||
|
) ==
|
||||||
|
false) {
|
||||||
|
setState(() {
|
||||||
|
_model.textController1?.clear();
|
||||||
|
_model.textController2?.clear();
|
||||||
|
_model.textController3?.clear();
|
||||||
|
_model.textController4?.clear();
|
||||||
|
_model.dropDownValueController?.reset();
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Visitante cadastrado com sucesso.',
|
||||||
|
enText:
|
||||||
|
'Visitor successfully registered.'),
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.info)),
|
||||||
|
backgroundColor:
|
||||||
|
FlutterFlowTheme.of(context).primary,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(15),
|
||||||
|
topRight: Radius.circular(15),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
if (widget.source ==
|
||||||
);
|
'VisitorNotFoundComponent') {
|
||||||
},
|
Navigator.pop(context);
|
||||||
);
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
if (PhpGroup.postScheduleVisitorCall.error(
|
return DialogUtil.error(
|
||||||
(_model.scheduleVisitor?.jsonBody ?? ''),
|
context,
|
||||||
) ==
|
PhpGroup.postScheduleVisitorCall
|
||||||
false) {
|
.errorMsg(
|
||||||
setState(() {
|
_model.scheduleVisitor?.jsonBody)
|
||||||
_model.textController1?.clearComposing();
|
.toString());
|
||||||
_model.textController2?.clearComposing();
|
}
|
||||||
_model.textController3?.clearComposing();
|
} else {
|
||||||
_model.textController4?.clearComposing();
|
DialogUtil.error(
|
||||||
_model.dropDownValueController?.reset();
|
context,
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
FFLocalizations.of(context).getVariableText(
|
||||||
SnackBar(
|
ptText:
|
||||||
content: Text(
|
'Visitante já cadastrado. Verifique se o documento foi preenchido corretamente.',
|
||||||
FFLocalizations.of(context).getVariableText(
|
enText:
|
||||||
ptText:
|
'Visitor already registered. Check if the document was filled in correctly.',
|
||||||
'Visitante cadastrado com sucesso.',
|
));
|
||||||
enText:
|
|
||||||
'Visitor successfully registered.'),
|
|
||||||
style: TextStyle(
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).info)),
|
|
||||||
backgroundColor:
|
|
||||||
FlutterFlowTheme.of(context).primary,
|
|
||||||
duration: const Duration(seconds: 3),
|
|
||||||
behavior: SnackBarBehavior.floating,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
if (widget.source == 'VisitorNotFoundComponent') {
|
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
} else {
|
: null,
|
||||||
await showAdaptiveDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
|
||||||
? FocusScope.of(context)
|
|
||||||
.requestFocus(_model.unfocusNode)
|
|
||||||
: FocusScope.of(context).unfocus(),
|
|
||||||
child: Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: Dialog(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg: PhpGroup.postScheduleVisitorCall
|
|
||||||
.errorMsg(_model
|
|
||||||
.scheduleVisitor?.jsonBody)
|
|
||||||
.toString()),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
await showAdaptiveDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Form.of(context)?.validate();
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
child: Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: Dialog(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg: FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
ptText:
|
|
||||||
'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.',
|
|
||||||
enText:
|
|
||||||
'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
|
||||||
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
text: FFLocalizations.of(context).getText(
|
text: FFLocalizations.of(context).getText(
|
||||||
'okbw0aiu' /* Cadastrar */,
|
'okbw0aiu' /* Cadastrar */,
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: 250.0,
|
width: 250.0,
|
||||||
height: 36.0,
|
height: 36.0,
|
||||||
|
disabledColor: FlutterFlowTheme.of(context).customColor6,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
80.0, 0.0, 80.0, 0.0),
|
80.0, 0.0, 80.0, 0.0),
|
||||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
|
|
@ -101,8 +101,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
TextEditingController(text: widget.visitStartDate);
|
TextEditingController(text: widget.visitStartDate);
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
_model.textFieldFocusNode2 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController3 ??=
|
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
||||||
TextEditingController(text: widget.visitEndDate);
|
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController4 ??=
|
_model.textController4 ??=
|
||||||
|
@ -212,20 +211,26 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
Navigator.pop(context);
|
// Navigator.pop(context);
|
||||||
await showModalBottomSheet(
|
// await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
// backgroundColor: Colors.transparent,
|
||||||
useSafeArea: true,
|
// useSafeArea: true,
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (context) {
|
// builder: (context) {
|
||||||
return Padding(
|
// return Padding(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
// padding: MediaQuery.viewInsetsOf(context),
|
||||||
child:
|
// child:
|
||||||
const VisitorDetailsModalTemplateComponentWidget(),
|
// const VisitorDetailsModalTemplateComponentWidget(
|
||||||
);
|
// visitorImageURL: '',
|
||||||
},
|
// visitorEmail: '',
|
||||||
).then((value) => safeSetState(() {}));
|
// visitorName: '',
|
||||||
|
// visitorPhone: '',
|
||||||
|
// visitorType: '',
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ).then((value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
|
@ -870,7 +875,6 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
Share.share(
|
Share.share(
|
||||||
'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
|
'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
|
||||||
);
|
);
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -6,7 +6,19 @@ import 'visitor_details_modal_template_component_model.dart';
|
||||||
export 'visitor_details_modal_template_component_model.dart';
|
export 'visitor_details_modal_template_component_model.dart';
|
||||||
|
|
||||||
class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget {
|
class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget {
|
||||||
const VisitorDetailsModalTemplateComponentWidget({super.key});
|
const VisitorDetailsModalTemplateComponentWidget(
|
||||||
|
{super.key,
|
||||||
|
required this.visitorImageURL,
|
||||||
|
required this.visitorName,
|
||||||
|
required this.visitorType,
|
||||||
|
required this.visitorPhone,
|
||||||
|
required this.visitorEmail});
|
||||||
|
|
||||||
|
final String? visitorImageURL;
|
||||||
|
final String? visitorName;
|
||||||
|
final String? visitorType;
|
||||||
|
final String? visitorPhone;
|
||||||
|
final String? visitorEmail;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VisitorDetailsModalTemplateComponentWidget> createState() =>
|
State<VisitorDetailsModalTemplateComponentWidget> createState() =>
|
||||||
|
@ -50,20 +62,40 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Container(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
width: double.infinity,
|
||||||
child: Container(
|
height: 34.0,
|
||||||
width: double.infinity,
|
decoration: BoxDecoration(
|
||||||
height: 34.0,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
decoration: BoxDecoration(
|
borderRadius: const BorderRadius.only(
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
bottomLeft: Radius.circular(0.0),
|
||||||
borderRadius: const BorderRadius.only(
|
bottomRight: Radius.circular(0.0),
|
||||||
bottomLeft: Radius.circular(0.0),
|
topLeft: Radius.circular(25.0),
|
||||||
bottomRight: Radius.circular(0.0),
|
topRight: Radius.circular(25.0),
|
||||||
topLeft: Radius.circular(0.0),
|
),
|
||||||
topRight: Radius.circular(0.0),
|
shape: BoxShape.rectangle,
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
10.0, 5.0, 15.0, 0.0),
|
||||||
|
child: InkWell(
|
||||||
|
splashColor: Colors.transparent,
|
||||||
|
focusColor: Colors.transparent,
|
||||||
|
hoverColor: Colors.transparent,
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
onTap: () async {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons.close,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
size: 24.0,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -71,68 +103,99 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(20.0, 40.0, 20.0, 0.0),
|
20.0, 40.0, 20.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Padding(
|
||||||
children: [
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
Padding(
|
0.0, 10.0, 0.0, 0.0),
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
child: Column(
|
||||||
0.0, 10.0, 0.0, 0.0),
|
mainAxisSize: MainAxisSize.max,
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
if (widget.visitorImageURL != '' &&
|
||||||
|
widget.visitorImageURL != null)
|
||||||
|
Container(
|
||||||
|
width: 100.0,
|
||||||
|
height: 100.0,
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: Image.network(
|
||||||
|
widget.visitorImageURL!,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
20.0, 0.0, 20.0, 0.0),
|
||||||
|
child: Text(
|
||||||
|
widget.visitorName ?? '',
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily,
|
||||||
|
fontSize: 24.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
.containsKey(
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
20.0, 0.0, 20.0, 30.0),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'hz7ivuqn' /* Tipo de Visitante */,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
.containsKey(
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Icon(
|
||||||
width: 100.0,
|
Icons.phone,
|
||||||
height: 100.0,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
clipBehavior: Clip.antiAlias,
|
size: 24.0,
|
||||||
decoration: const BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: Image.network(
|
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment:
|
||||||
|
const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
20.0, 0.0, 20.0, 0.0),
|
20.0, 0.0, 20.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'kqzf7nx2' /* Nome do Visitante */,
|
'rwqn0det' /* (00) 0 0000-0000 */,
|
||||||
),
|
|
||||||
textAlign: TextAlign.start,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
fontSize: 24.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
20.0, 0.0, 20.0, 30.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'hz7ivuqn' /* Tipo de Visitante */,
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
|
@ -151,128 +214,67 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.phone,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
20.0, 0.0, 20.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'rwqn0det' /* (00) 0 0000-0000 */,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.start,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.email,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
20.0, 0.0, 20.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'0wqbiekp' /* email@provider.etc */,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.start,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
],
|
mainAxisSize: MainAxisSize.max,
|
||||||
),
|
children: [
|
||||||
),
|
Icon(
|
||||||
),
|
Icons.email,
|
||||||
),
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
Align(
|
size: 24.0,
|
||||||
alignment: const AlignmentDirectional(-1.0, -1.0),
|
),
|
||||||
child: Container(
|
Align(
|
||||||
width: double.infinity,
|
alignment:
|
||||||
height: 34.0,
|
const AlignmentDirectional(-1.0, 0.0),
|
||||||
decoration: BoxDecoration(
|
child: Padding(
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
borderRadius: const BorderRadius.only(
|
20.0, 0.0, 20.0, 0.0),
|
||||||
bottomLeft: Radius.circular(0.0),
|
child: Text(
|
||||||
bottomRight: Radius.circular(0.0),
|
FFLocalizations.of(context).getText(
|
||||||
topLeft: Radius.circular(25.0),
|
'0wqbiekp' /* email@provider.etc */,
|
||||||
topRight: Radius.circular(25.0),
|
),
|
||||||
),
|
textAlign: TextAlign.start,
|
||||||
shape: BoxShape.rectangle,
|
style: FlutterFlowTheme.of(context)
|
||||||
),
|
.bodyMedium
|
||||||
child: Align(
|
.override(
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
fontFamily:
|
||||||
child: Padding(
|
FlutterFlowTheme.of(context)
|
||||||
padding:
|
.bodyMediumFamily,
|
||||||
const EdgeInsetsDirectional.fromSTEB(10.0, 5.0, 15.0, 0.0),
|
letterSpacing: 0.0,
|
||||||
child: InkWell(
|
fontWeight: FontWeight.bold,
|
||||||
splashColor: Colors.transparent,
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
focusColor: Colors.transparent,
|
.containsKey(
|
||||||
hoverColor: Colors.transparent,
|
FlutterFlowTheme.of(context)
|
||||||
highlightColor: Colors.transparent,
|
.bodyMediumFamily),
|
||||||
onTap: () async {
|
),
|
||||||
Navigator.pop(context);
|
),
|
||||||
},
|
),
|
||||||
child: Icon(
|
),
|
||||||
Icons.close,
|
],
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
),
|
||||||
size: 24.0,
|
],
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// Align(
|
||||||
|
// alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
|
// child: Container(
|
||||||
|
// width: double.infinity,
|
||||||
|
// height: 34.0,
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
// borderRadius: const BorderRadius.only(
|
||||||
|
// bottomLeft: Radius.circular(0.0),
|
||||||
|
// bottomRight: Radius.circular(0.0),
|
||||||
|
// topLeft: Radius.circular(0.0),
|
||||||
|
// topRight: Radius.circular(0.0),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -47,12 +47,6 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
|
|
||||||
_model.textController ??= TextEditingController();
|
_model.textController ??= TextEditingController();
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
_model.textFieldFocusNode ??= FocusNode();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) => setState(() {
|
|
||||||
_model.textController?.text = FFLocalizations.of(context).getText(
|
|
||||||
'oj12tamm' /* test */,
|
|
||||||
);
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -91,10 +85,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
focusNode: _model.textFieldFocusNode,
|
focusNode: _model.textFieldFocusNode,
|
||||||
onFieldSubmitted: (_) async {
|
onFieldSubmitted: (_) async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_model.textController?.text = valueOrDefault<String>(
|
_model.textController?.text = _model.textController.text;
|
||||||
_model.textController.text,
|
|
||||||
'69696777',
|
|
||||||
);
|
|
||||||
_model.textController?.selection = TextSelection.collapsed(
|
_model.textController?.selection = TextSelection.collapsed(
|
||||||
offset: _model.textController!.text.length);
|
offset: _model.textController!.text.length);
|
||||||
});
|
});
|
||||||
|
@ -268,7 +259,6 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final visitor =
|
final visitor =
|
||||||
_model.visitors.map((e) => e).toList();
|
_model.visitors.map((e) => e).toList();
|
||||||
|
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
|
@ -284,39 +274,42 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await showModalBottomSheet(
|
// await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
enableDrag: false,
|
// enableDrag: true,
|
||||||
context: context,
|
// isDismissible: true,
|
||||||
builder: (context) {
|
// context: context,
|
||||||
return Padding(
|
// builder: (context) {
|
||||||
padding:
|
// return Padding(
|
||||||
MediaQuery.viewInsetsOf(context),
|
// padding:
|
||||||
child: const SizedBox(
|
// MediaQuery.viewInsetsOf(context),
|
||||||
height: 610.0,
|
// child: SizedBox(
|
||||||
child:
|
// height: 610.0,
|
||||||
VisitorDetailsModalTemplateComponentWidget(),
|
// child:
|
||||||
),
|
// VisitorDetailsModalTemplateComponentWidget(
|
||||||
);
|
// visitorImageURL:
|
||||||
},
|
// "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||||
).then((value) => safeSetState(() {}));
|
// visitorItem,
|
||||||
|
// r'''$.VTE_DOCUMENTO''',
|
||||||
|
// ).toString()}&tipo=E",
|
||||||
|
// visitorEmail: '',
|
||||||
|
// visitorName: getJsonField(
|
||||||
|
// visitorItem,
|
||||||
|
// r'''$.VTE_NOME''',
|
||||||
|
// )?.toString(),
|
||||||
|
// visitorPhone: '',
|
||||||
|
// visitorType: '',
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ).then((value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context)
|
||||||
.secondaryBackground,
|
.primaryBackground,
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
blurRadius: 0.0,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.alternate,
|
|
||||||
offset: const Offset(
|
|
||||||
0.0,
|
|
||||||
1.0,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
@ -333,13 +326,11 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
milliseconds: 500),
|
milliseconds: 500),
|
||||||
fadeOutDuration: const Duration(
|
fadeOutDuration: const Duration(
|
||||||
milliseconds: 500),
|
milliseconds: 500),
|
||||||
imageUrl: valueOrDefault<String>(
|
imageUrl:
|
||||||
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||||
visitorItem,
|
visitorItem,
|
||||||
r'''$.VTE_DOCUMENTO''',
|
r'''$.VTE_DOCUMENTO''',
|
||||||
).toString()}&tipo=E",
|
).toString()}&tipo=E",
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
|
||||||
),
|
|
||||||
width: 60.0,
|
width: 60.0,
|
||||||
height: 60.0,
|
height: 60.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
@ -348,6 +339,8 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -382,58 +375,6 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
4.0, 4.0, 0.0, 0.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
0.0, -1.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
10.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
child: Text(
|
|
||||||
getJsonField(
|
|
||||||
visitorItem,
|
|
||||||
r'''$.VTE_TELEFONE''',
|
|
||||||
).toString(),
|
|
||||||
style: FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primary,
|
|
||||||
letterSpacing:
|
|
||||||
0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -442,10 +383,10 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
buttonSize: 40.0,
|
buttonSize: 40.0,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.restore_from_trash,
|
Icons.close,
|
||||||
color:
|
color:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.primary,
|
.customColor6,
|
||||||
size: 20.0,
|
size: 20.0,
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
@ -470,54 +411,65 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
FFButtonWidget(
|
Row(
|
||||||
onPressed: () async {
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
await widget.getVisitors?.call(
|
mainAxisSize: MainAxisSize.max,
|
||||||
_model.visitors,
|
children: [
|
||||||
);
|
FFButtonWidget(
|
||||||
await widget.getDocs?.call(
|
onPressed: () async {
|
||||||
_model.docs,
|
await widget.getVisitors?.call(
|
||||||
);
|
_model.visitors,
|
||||||
Navigator.pop(context);
|
);
|
||||||
},
|
await widget.getDocs?.call(
|
||||||
text: FFLocalizations.of(context).getText(
|
_model.docs,
|
||||||
'ug6qzyla' /* Adicionar */,
|
);
|
||||||
),
|
Navigator.pop(context);
|
||||||
options: FFButtonOptions(
|
},
|
||||||
width: double.infinity,
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
height: 30.0,
|
enText: 'Add',
|
||||||
padding:
|
ptText: 'Adicionar',
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
),
|
||||||
iconPadding:
|
options: FFButtonOptions(
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
height: MediaQuery.of(context).size.width * 0.1,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
24.0, 0.0, 24.0, 0.0),
|
||||||
color: Colors.white,
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
letterSpacing: 0.0,
|
0.0, 0.0, 0.0, 0.0),
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
FlutterFlowTheme.of(context).titleSmallFamily),
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).titleSmallFamily,
|
||||||
|
color: Colors.white,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).titleSmallFamily),
|
||||||
|
),
|
||||||
|
elevation: 3.0,
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: Colors.transparent,
|
||||||
|
width: 1.0,
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
borderRadius: const BorderRadius.only(
|
||||||
borderSide: const BorderSide(
|
bottomLeft: Radius.circular(15),
|
||||||
color: Colors.transparent,
|
bottomRight: Radius.circular(15),
|
||||||
width: 1.0,
|
topLeft: Radius.circular(15),
|
||||||
|
topRight: Radius.circular(15),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
borderRadius: const BorderRadius.only(
|
],
|
||||||
bottomLeft: Radius.circular(0.0),
|
|
||||||
bottomRight: Radius.circular(0.0),
|
|
||||||
topLeft: Radius.circular(0.0),
|
|
||||||
topRight: Radius.circular(0.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10.0,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
||||||
|
|
||||||
class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget> {
|
class MessageHistoryPageModel
|
||||||
|
extends FlutterFlowModel<MessageHistoryPageWidget> {
|
||||||
/// State fields for stateful widgets in this page.
|
/// State fields for stateful widgets in this page.
|
||||||
///
|
///
|
||||||
|
|
||||||
|
@ -49,7 +50,6 @@ class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget>
|
||||||
textController?.dispose();
|
textController?.dispose();
|
||||||
tabBarController?.dispose();
|
tabBarController?.dispose();
|
||||||
|
|
||||||
|
|
||||||
/// Dispose query cache managers for this widget.
|
/// Dispose query cache managers for this widget.
|
||||||
|
|
||||||
clearGetLiberationsCache();
|
clearGetLiberationsCache();
|
||||||
|
|
|
@ -12,7 +12,6 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/message_history_page/message_history_page_model.dart';
|
import 'package:hub/pages/message_history_page/message_history_page_model.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
@ -26,7 +25,8 @@ class MessageHistoryPageWidget extends StatefulWidget {
|
||||||
_MessageHistoryPageWidgetState();
|
_MessageHistoryPageWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget> with TickerProviderStateMixin {
|
class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
|
||||||
|
with TickerProviderStateMixin {
|
||||||
late MessageHistoryPageModel _model;
|
late MessageHistoryPageModel _model;
|
||||||
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
@ -36,7 +36,7 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget> wit
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => MessageHistoryPageModel());
|
_model = createModel(context, () => MessageHistoryPageModel());
|
||||||
|
|
||||||
_model.tabBarController = TabController(
|
_model.tabBarController = TabController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
length: 3,
|
length: 3,
|
||||||
initialIndex: 1,
|
initialIndex: 1,
|
||||||
|
@ -106,8 +106,7 @@ PreferredSizeWidget appBarMessage(BuildContext context) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget bodyMessage(
|
Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) {
|
||||||
BuildContext context, MessageHistoryPageModel _model) {
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
top: true,
|
top: true,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -155,33 +154,26 @@ Widget bodyMessage(
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(child: TabBarView(
|
Expanded(
|
||||||
controller: _model.tabBarController,
|
child: TabBarView(controller: _model.tabBarController, children: [
|
||||||
children: [
|
liberationDynamicListView(context, _model, 'P'),
|
||||||
liberationDynamicListView(context, _model, 'P'),
|
liberationDynamicListView(context, _model, 'A'),
|
||||||
liberationDynamicListView(context, _model, 'A'),
|
liberationDynamicListView(context, _model, 'T'),
|
||||||
liberationDynamicListView(context, _model, 'T'),
|
])),
|
||||||
]
|
|
||||||
)),
|
|
||||||
].addToStart(const SizedBox(height: 0)),
|
].addToStart(const SizedBox(height: 0)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Widget liberationDynamicListView(
|
Widget liberationDynamicListView(
|
||||||
BuildContext context,
|
BuildContext context, MessageHistoryPageModel _model, String DestIndex) {
|
||||||
MessageHistoryPageModel _model,
|
|
||||||
String DestIndex
|
|
||||||
) {
|
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: FutureBuilder<ApiCallResponse>(
|
child: FutureBuilder<ApiCallResponse>(
|
||||||
future: PhpGroup.getMessagesCall.call(
|
future: PhpGroup.getMessagesCall
|
||||||
|
.call(
|
||||||
devUUID: FFAppState().devUUID.toString(),
|
devUUID: FFAppState().devUUID.toString(),
|
||||||
userUUID: FFAppState().userUUID.toString(),
|
userUUID: FFAppState().userUUID.toString(),
|
||||||
cliID: FFAppState().cliUUID.toString(),
|
cliID: FFAppState().cliUUID.toString(),
|
||||||
|
@ -189,7 +181,8 @@ Widget liberationDynamicListView(
|
||||||
pageSize: '100',
|
pageSize: '100',
|
||||||
pageNumber: '1',
|
pageNumber: '1',
|
||||||
tipoDestino: DestIndex,
|
tipoDestino: DestIndex,
|
||||||
).catchError((error) {
|
)
|
||||||
|
.catchError((error) {
|
||||||
log('Error: ${error.toString()}');
|
log('Error: ${error.toString()}');
|
||||||
return Future.delayed(Duration(seconds: 1), () {
|
return Future.delayed(Duration(seconds: 1), () {
|
||||||
return Center(
|
return Center(
|
||||||
|
@ -217,8 +210,15 @@ Widget liberationDynamicListView(
|
||||||
child: Text('Erro ao carregar mensagens'),
|
child: Text('Erro ao carregar mensagens'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
final mensagens = snapshot.data!.jsonBody['mensagens'];
|
||||||
|
final totalRows = snapshot.data!.jsonBody['total_rows'];
|
||||||
|
if (totalRows == 0 || mensagens == null || mensagens.isEmpty) {
|
||||||
|
return const Center(
|
||||||
|
child: Text('Nenhuma mensagem encontrada'),
|
||||||
|
);
|
||||||
|
}
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
itemCount: snapshot.data!.jsonBody['total_rows'],
|
itemCount: totalRows,
|
||||||
addAutomaticKeepAlives: false,
|
addAutomaticKeepAlives: false,
|
||||||
addRepaintBoundaries: true,
|
addRepaintBoundaries: true,
|
||||||
cacheExtent: 1000.0,
|
cacheExtent: 1000.0,
|
||||||
|
@ -234,8 +234,7 @@ Widget liberationDynamicListView(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget messageHistoryItem(
|
Widget messageHistoryItem(BuildContext context, dynamic jsonBody) {
|
||||||
BuildContext context, dynamic jsonBody) {
|
|
||||||
log(jsonBody.toString());
|
log(jsonBody.toString());
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
|
@ -250,55 +249,60 @@ Widget messageHistoryItem(
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Row(
|
||||||
padding: const EdgeInsets.only(left: 15.0),
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
child: Text(
|
mainAxisSize: MainAxisSize.max,
|
||||||
jsonBody['MSG_DATE'].toString(),
|
children: [
|
||||||
style: TextStyle(
|
Padding(
|
||||||
fontWeight: FontWeight.bold,
|
padding: const EdgeInsets.only(left: 15.0),
|
||||||
fontSize: 16,
|
child: Text(
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
jsonBody['MSG_DATE'].toString(),
|
||||||
overflow: TextOverflow.ellipsis,
|
style: TextStyle(
|
||||||
),
|
fontWeight: FontWeight.bold,
|
||||||
),
|
fontSize: 10,
|
||||||
),
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
Icon(
|
overflow: TextOverflow.ellipsis,
|
||||||
jsonBody['MSG_DESTINO_TP'] == 'T'
|
),
|
||||||
? Icons.group
|
|
||||||
: Icons.person,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 8),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
|
||||||
child: Text(
|
|
||||||
jsonBody['MSG_ORIGEM_DESC'].toString(),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 16,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
),
|
||||||
overflow: TextOverflow.fade,
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
||||||
|
child: Text(
|
||||||
|
jsonBody['MSG_ORIGEM_DESC'].toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Icon(
|
||||||
|
jsonBody['MSG_DESTINO_TP'] == 'T'
|
||||||
|
? Icons.group
|
||||||
|
: Icons.person,
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
Text(jsonBody['MSG_TEXTO'].toString(),),
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
jsonBody['MSG_TEXTO'].toString(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -51,41 +51,8 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
|
|
||||||
void enablePerson(BuildContext context) {
|
void enablePerson(BuildContext context) {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
Share.share(
|
||||||
SnackBar(
|
FFAppState().userDevUUID,
|
||||||
content: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(FFAppState().userDevUUID,
|
|
||||||
style: TextStyle(color: FlutterFlowTheme.of(context).info)),
|
|
||||||
FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.share,
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
log('IconButton pressed ...');
|
|
||||||
// Implement share functionality here
|
|
||||||
Share.share(
|
|
||||||
FFAppState().userDevUUID,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
|
||||||
duration: const Duration(seconds: 1),
|
|
||||||
behavior: SnackBarBehavior.floating,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,8 +113,8 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
onPressed = () => model.enablePerson(context);
|
onPressed = () => model.enablePerson(context);
|
||||||
isEnabled = FFAppState().person;
|
isEnabled = FFAppState().person;
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Exibir código de identificação remota',
|
ptText: 'Compartilhe o código de identificação remota',
|
||||||
enText: 'Display remote identification code',
|
enText: 'Share the remote identification code',
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
import 'package:hub/flutter_flow/form_field_controller.dart';
|
||||||
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class ScheduleCompleteVisitPageModel
|
class ScheduleCompleteVisitPageModel
|
||||||
extends FlutterFlowModel<ScheduleCompleteVisitPageWidget> {
|
extends FlutterFlowModel<ScheduleCompleteVisitPageWidget> {
|
||||||
|
@ -37,6 +40,18 @@ class ScheduleCompleteVisitPageModel
|
||||||
visitorJsonList[index] = updateFn(visitorJsonList[index]);
|
visitorJsonList[index] = updateFn(visitorJsonList[index]);
|
||||||
|
|
||||||
String visitorStrList = '0';
|
String visitorStrList = '0';
|
||||||
|
bool? dropDownValidator1;
|
||||||
|
bool? dropDownValidator2;
|
||||||
|
|
||||||
|
bool isValid() {
|
||||||
|
if ((textController1!.text != '') &&
|
||||||
|
(textController2!.text != '') &&
|
||||||
|
(dropDownValue1 != null && dropDownValue1 != '') &&
|
||||||
|
(dropDownValue2 != null && dropDownValue2 != '')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// State fields for stateful widgets in this page.
|
/// State fields for stateful widgets in this page.
|
||||||
|
|
||||||
|
@ -50,16 +65,66 @@ class ScheduleCompleteVisitPageModel
|
||||||
FocusNode? textFieldFocusNode1;
|
FocusNode? textFieldFocusNode1;
|
||||||
TextEditingController? textController1;
|
TextEditingController? textController1;
|
||||||
String? Function(BuildContext, String?)? textController1Validator;
|
String? Function(BuildContext, String?)? textController1Validator;
|
||||||
|
String? _textController1Validator(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 != null) {
|
||||||
|
try {
|
||||||
|
DateTime startDate = DateFormat('d/M/y H:mm:ss').parse(val);
|
||||||
|
DateTime endDate =
|
||||||
|
DateFormat('d/M/y H:mm:ss').parse(textController2!.text);
|
||||||
|
if (startDate.isAfter(endDate)) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'A data de início deve ser anterior à data de término.',
|
||||||
|
enText: 'Start date must be before end date.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return '$e';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
DateTime? datePicked1;
|
DateTime? datePicked1;
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode2;
|
FocusNode? textFieldFocusNode2;
|
||||||
TextEditingController? textController2;
|
TextEditingController? textController2;
|
||||||
String? Function(BuildContext, String?)? textController2Validator;
|
String? Function(BuildContext, String?)? textController2Validator;
|
||||||
|
String? _textController2Validator(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 != null) {
|
||||||
|
try {
|
||||||
|
DateTime endDate = DateFormat('d/M/y H:mm:ss').parse(val);
|
||||||
|
DateTime startDate =
|
||||||
|
DateFormat('d/M/y H:mm:ss').parse(textController1!.text);
|
||||||
|
if (endDate.isBefore(startDate)) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'End date must be after start date.',
|
||||||
|
ptText: 'A data de término deve ser posterior à data de início.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return '$e';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
DateTime? datePicked2;
|
DateTime? datePicked2;
|
||||||
// State field(s) for DropDown widget.
|
// State field(s) for DropDown widget.
|
||||||
String? dropDownValue1;
|
String? dropDownValue1;
|
||||||
FormFieldController<String>? dropDownValueController1;
|
FormFieldController<String>? dropDownValueController1;
|
||||||
|
|
||||||
// State field(s) for DropDown widget.
|
// State field(s) for DropDown widget.
|
||||||
String? dropDownValue2;
|
String? dropDownValue2;
|
||||||
FormFieldController<String>? dropDownValueController2;
|
FormFieldController<String>? dropDownValueController2;
|
||||||
|
@ -69,9 +134,35 @@ class ScheduleCompleteVisitPageModel
|
||||||
FocusNode? textFieldFocusNode3;
|
FocusNode? textFieldFocusNode3;
|
||||||
TextEditingController? textController3;
|
TextEditingController? textController3;
|
||||||
String? Function(BuildContext, String?)? textController3Validator;
|
String? Function(BuildContext, String?)? textController3Validator;
|
||||||
|
String? _textController3Validator(BuildContext context, String? val) {
|
||||||
|
// if (val == null || val.isEmpty) {
|
||||||
|
// return FFLocalizations.of(context).getVariableText(
|
||||||
|
// enText: 'This field is required.',
|
||||||
|
// ptText: 'Este campo é obrigatório.',
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {
|
||||||
|
tabBarController = TabController(
|
||||||
|
vsync: Navigator.of(context),
|
||||||
|
length: 2,
|
||||||
|
);
|
||||||
|
|
||||||
|
textFieldFocusNode1 = FocusNode();
|
||||||
|
textController1 = TextEditingController();
|
||||||
|
textController1Validator = _textController1Validator;
|
||||||
|
|
||||||
|
textFieldFocusNode2 = FocusNode();
|
||||||
|
textController2 = TextEditingController();
|
||||||
|
textController2Validator = _textController2Validator;
|
||||||
|
|
||||||
|
textFieldFocusNode3 = FocusNode();
|
||||||
|
textController3 = TextEditingController();
|
||||||
|
textController3Validator = _textController3Validator;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue