981 lines
53 KiB
Dart
981 lines
53 KiB
Dart
import '/backend/api_requests/api_calls.dart';
|
|
import '/flutter_flow/flutter_flow_icon_button.dart';
|
|
import '/flutter_flow/flutter_flow_theme.dart';
|
|
import '/flutter_flow/flutter_flow_util.dart';
|
|
import '/modals/throw_exception/throw_exception_widget.dart';
|
|
import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart';
|
|
import '/flutter_flow/custom_functions.dart' as functions;
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'schedule_visit_detail_model.dart';
|
|
export 'schedule_visit_detail_model.dart';
|
|
|
|
class ScheduleVisitDetailWidget extends StatefulWidget {
|
|
const ScheduleVisitDetailWidget({
|
|
super.key,
|
|
required this.visitorJsonList,
|
|
required this.visitorStrList,
|
|
this.visitorImgPath,
|
|
required this.visitStartDate,
|
|
required this.visitEndDate,
|
|
required this.visitResonStr,
|
|
required this.visitLevelStr,
|
|
required this.visitTempStr,
|
|
required this.visitObsStr,
|
|
});
|
|
|
|
final List<dynamic>? visitorJsonList;
|
|
final String? visitorStrList;
|
|
final String? visitorImgPath;
|
|
final String? visitStartDate;
|
|
final String? visitEndDate;
|
|
final String? visitResonStr;
|
|
final String? visitLevelStr;
|
|
final String? visitTempStr;
|
|
final String? visitObsStr;
|
|
|
|
@override
|
|
State<ScheduleVisitDetailWidget> createState() =>
|
|
_ScheduleVisitDetailWidgetState();
|
|
}
|
|
|
|
class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|
late ScheduleVisitDetailModel _model;
|
|
|
|
@override
|
|
void setState(VoidCallback callback) {
|
|
super.setState(callback);
|
|
_model.onUpdate();
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_model = createModel(context, () => ScheduleVisitDetailModel());
|
|
|
|
_model.textController1 ??=
|
|
TextEditingController(text: widget.visitTempStr);
|
|
_model.textFieldFocusNode1 ??= FocusNode();
|
|
|
|
_model.textController2 ??=
|
|
TextEditingController(text: widget.visitStartDate);
|
|
_model.textFieldFocusNode2 ??= FocusNode();
|
|
|
|
_model.textController3 ??=
|
|
TextEditingController(text: widget.visitEndDate);
|
|
_model.textFieldFocusNode3 ??= FocusNode();
|
|
|
|
_model.textController4 ??= TextEditingController(
|
|
text: functions.extractDescToStr(widget.visitResonStr!));
|
|
_model.textFieldFocusNode4 ??= FocusNode();
|
|
|
|
_model.textController5 ??= TextEditingController(
|
|
text: functions.extractDescToStr(widget.visitLevelStr!));
|
|
_model.textFieldFocusNode5 ??= FocusNode();
|
|
|
|
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
|
_model.textFieldFocusNode6 ??= FocusNode();
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_model.maybeDispose();
|
|
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
context.watch<FFAppState>();
|
|
|
|
return Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0),
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: double.infinity,
|
|
decoration: BoxDecoration(
|
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
borderRadius: const BorderRadius.only(
|
|
bottomLeft: Radius.circular(25.0),
|
|
bottomRight: Radius.circular(25.0),
|
|
topLeft: Radius.circular(25.0),
|
|
topRight: Radius.circular(25.0),
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Align(
|
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: 35.0,
|
|
decoration: BoxDecoration(
|
|
color: FlutterFlowTheme.of(context).primary,
|
|
borderRadius: const BorderRadius.only(
|
|
bottomLeft: Radius.circular(0.0),
|
|
bottomRight: Radius.circular(0.0),
|
|
topLeft: Radius.circular(25.0),
|
|
topRight: Radius.circular(25.0),
|
|
),
|
|
),
|
|
child: Visibility(
|
|
visible: widget.visitorStrList != null &&
|
|
widget.visitorStrList != '',
|
|
child: Align(
|
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
|
child: Padding(
|
|
padding:
|
|
const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
|
child: FlutterFlowIconButton(
|
|
borderRadius: 20.0,
|
|
borderWidth: 1.0,
|
|
buttonSize: 40.0,
|
|
icon: Icon(
|
|
Icons.keyboard_return,
|
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
size: 24.0,
|
|
),
|
|
onPressed: () async {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
decoration: const BoxDecoration(
|
|
shape: BoxShape.rectangle,
|
|
),
|
|
child: Stack(
|
|
children: [
|
|
Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
Align(
|
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
5.0, 0.0, 5.0, 20.0),
|
|
child: Container(
|
|
width: 100.0,
|
|
decoration: const BoxDecoration(),
|
|
child: Builder(
|
|
builder: (context) {
|
|
final visitorsData = widget.visitorJsonList!
|
|
.toList()
|
|
.take(1)
|
|
.toList();
|
|
|
|
return SingleChildScrollView(
|
|
scrollDirection: Axis.horizontal,
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: List.generate(visitorsData.length,
|
|
(visitorsDataIndex) {
|
|
final visitorsDataItem =
|
|
visitorsData[visitorsDataIndex];
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
borderRadius:
|
|
BorderRadius.circular(100.0),
|
|
),
|
|
child: Align(
|
|
alignment:
|
|
const AlignmentDirectional(1.0, -1.0),
|
|
child: InkWell(
|
|
splashColor: Colors.transparent,
|
|
focusColor: Colors.transparent,
|
|
hoverColor: Colors.transparent,
|
|
highlightColor: Colors.transparent,
|
|
onTap: () async {
|
|
Navigator.pop(context);
|
|
await showModalBottomSheet(
|
|
isScrollControlled: true,
|
|
backgroundColor:
|
|
Colors.transparent,
|
|
useSafeArea: true,
|
|
context: context,
|
|
builder: (context) {
|
|
return Padding(
|
|
padding:
|
|
MediaQuery.viewInsetsOf(
|
|
context),
|
|
child:
|
|
const VisitorDetailsModalTemplateComponentWidget(),
|
|
);
|
|
},
|
|
).then((value) =>
|
|
safeSetState(() {}));
|
|
},
|
|
child: ClipRRect(
|
|
borderRadius:
|
|
BorderRadius.circular(100.0),
|
|
child: CachedNetworkImage(
|
|
fadeInDuration:
|
|
const Duration(milliseconds: 500),
|
|
fadeOutDuration:
|
|
const Duration(milliseconds: 500),
|
|
imageUrl:
|
|
valueOrDefault<String>(
|
|
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
|
visitorsDataItem,
|
|
r'''$.VTE_DOCUMENTO''',
|
|
).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: 100.0,
|
|
height: 100.0,
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
decoration: const BoxDecoration(),
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
8.0, 0.0, 8.0, 10.0),
|
|
child: TextFormField(
|
|
controller: _model.textController1,
|
|
focusNode: _model.textFieldFocusNode1,
|
|
autofocus: false,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
isDense: false,
|
|
labelText:
|
|
FFLocalizations.of(context).getText(
|
|
'7w4fohoa' /* Encerramento da Visita */,
|
|
),
|
|
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).accent1,
|
|
width: 0.5,
|
|
),
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color:
|
|
FlutterFlowTheme.of(context).primary,
|
|
width: 0.5,
|
|
),
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context).error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context).error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily: FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap()
|
|
.containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily),
|
|
),
|
|
validator: _model.textController1Validator
|
|
.asValidator(context),
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
0.0, 0.0, 0.0, 10.0),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
8.0, 0.0, 8.0, 0.0),
|
|
child: TextFormField(
|
|
controller: _model.textController2,
|
|
focusNode: _model.textFieldFocusNode2,
|
|
autofocus: false,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
labelText:
|
|
FFLocalizations.of(context).getText(
|
|
'snah4iet' /* Início */,
|
|
),
|
|
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),
|
|
),
|
|
hintText:
|
|
FFLocalizations.of(context).getText(
|
|
'0cp1e31d' /* dd/mm/yyyy */,
|
|
),
|
|
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)
|
|
.accent1,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.primary,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap()
|
|
.containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily),
|
|
),
|
|
textAlign: TextAlign.center,
|
|
validator: _model.textController2Validator
|
|
.asValidator(context),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
8.0, 0.0, 8.0, 0.0),
|
|
child: TextFormField(
|
|
controller: _model.textController3,
|
|
focusNode: _model.textFieldFocusNode3,
|
|
autofocus: false,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
labelText:
|
|
FFLocalizations.of(context).getText(
|
|
'abppdgz3' /* Término */,
|
|
),
|
|
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),
|
|
),
|
|
hintText:
|
|
FFLocalizations.of(context).getText(
|
|
'kqralft4' /* dd/mm/yyyy */,
|
|
),
|
|
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)
|
|
.accent1,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.primary,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap()
|
|
.containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily),
|
|
),
|
|
textAlign: TextAlign.center,
|
|
validator: _model.textController3Validator
|
|
.asValidator(context),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
0.0, 0.0, 0.0, 10.0),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
8.0, 0.0, 8.0, 0.0),
|
|
child: TextFormField(
|
|
controller: _model.textController4,
|
|
focusNode: _model.textFieldFocusNode4,
|
|
autofocus: false,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
labelText:
|
|
FFLocalizations.of(context).getText(
|
|
'xjxhzqqm' /* Motivo da Visita */,
|
|
),
|
|
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),
|
|
),
|
|
hintText:
|
|
FFLocalizations.of(context).getText(
|
|
'47oezdm6' /* Motivo */,
|
|
),
|
|
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)
|
|
.accent1,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.primary,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap()
|
|
.containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily),
|
|
),
|
|
textAlign: TextAlign.center,
|
|
validator: _model.textController4Validator
|
|
.asValidator(context),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
8.0, 0.0, 8.0, 0.0),
|
|
child: TextFormField(
|
|
controller: _model.textController5,
|
|
focusNode: _model.textFieldFocusNode5,
|
|
autofocus: false,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
labelText:
|
|
FFLocalizations.of(context).getText(
|
|
'2ujg7u18' /* Nível de Acesso */,
|
|
),
|
|
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),
|
|
),
|
|
hintText:
|
|
FFLocalizations.of(context).getText(
|
|
'3emmbbfv' /* Nível de Acesso */,
|
|
),
|
|
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)
|
|
.accent1,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.primary,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context)
|
|
.error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8.0),
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap()
|
|
.containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily),
|
|
),
|
|
textAlign: TextAlign.center,
|
|
validator: _model.textController5Validator
|
|
.asValidator(context),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
decoration: const BoxDecoration(),
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
8.0, 0.0, 8.0, 0.0),
|
|
child: TextFormField(
|
|
controller: _model.textController6,
|
|
focusNode: _model.textFieldFocusNode6,
|
|
autofocus: false,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
labelText:
|
|
FFLocalizations.of(context).getText(
|
|
'ritce5uw' /* Observações da Visita */,
|
|
),
|
|
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).accent1,
|
|
width: 0.5,
|
|
),
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color:
|
|
FlutterFlowTheme.of(context).primary,
|
|
width: 0.5,
|
|
),
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context).error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context).error,
|
|
width: 0.5,
|
|
),
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily: FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap()
|
|
.containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily),
|
|
),
|
|
validator: _model.textController6Validator
|
|
.asValidator(context),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Container(
|
|
width: double.infinity,
|
|
height: 22.0,
|
|
decoration: BoxDecoration(
|
|
color:
|
|
FlutterFlowTheme.of(context).secondaryBackground,
|
|
borderRadius: const BorderRadius.only(
|
|
bottomLeft: Radius.circular(25.0),
|
|
bottomRight: Radius.circular(25.0),
|
|
topLeft: Radius.circular(0.0),
|
|
topRight: Radius.circular(0.0),
|
|
),
|
|
),
|
|
),
|
|
]
|
|
.divide(const SizedBox(height: 30.0))
|
|
.addToStart(const SizedBox(height: 100.0)),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Align(
|
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: 35.0,
|
|
decoration: BoxDecoration(
|
|
color: FlutterFlowTheme.of(context).primary,
|
|
borderRadius: const BorderRadius.only(
|
|
bottomLeft: Radius.circular(0.0),
|
|
bottomRight: Radius.circular(0.0),
|
|
topLeft: Radius.circular(0.0),
|
|
topRight: Radius.circular(0.0),
|
|
),
|
|
),
|
|
child: InkWell(
|
|
splashColor: Colors.transparent,
|
|
focusColor: Colors.transparent,
|
|
hoverColor: Colors.transparent,
|
|
highlightColor: Colors.transparent,
|
|
onTap: () async {
|
|
_model.postScheduleVisit =
|
|
await PhpGroup.postScheduleVisitCall.call(
|
|
devUUID: FFAppState().devUUID,
|
|
userUUID: FFAppState().userUUID,
|
|
atividade: 'putVisita',
|
|
devDesc: widget.visitObsStr,
|
|
idVisitante: widget.visitorStrList,
|
|
dtInicio: widget.visitStartDate,
|
|
dtFim: widget.visitEndDate,
|
|
unica: widget.visitTempStr,
|
|
idMotivo:
|
|
functions.extractIdToStr(widget.visitResonStr!),
|
|
idNAC: functions.extractIdToStr(widget.visitLevelStr!),
|
|
obs: widget.visitObsStr,
|
|
cliID: FFAppState().cliUUID,
|
|
);
|
|
|
|
if (PhpGroup.postScheduleVisitCall.error(
|
|
(_model.postScheduleVisit?.jsonBody ?? ''),
|
|
) ==
|
|
false) {
|
|
Navigator.pop(context);
|
|
} else {
|
|
await showModalBottomSheet(
|
|
isScrollControlled: true,
|
|
backgroundColor: Colors.transparent,
|
|
enableDrag: false,
|
|
context: context,
|
|
builder: (context) {
|
|
return Padding(
|
|
padding: MediaQuery.viewInsetsOf(context),
|
|
child: ThrowExceptionWidget(
|
|
msg: PhpGroup.postScheduleVisitCall.errorMsg(
|
|
(_model.postScheduleVisit?.jsonBody ?? ''),
|
|
)!,
|
|
),
|
|
);
|
|
},
|
|
).then((value) => safeSetState(() {}));
|
|
}
|
|
|
|
setState(() {});
|
|
},
|
|
child: Icon(
|
|
Icons.save_alt,
|
|
color: FlutterFlowTheme.of(context).secondaryText,
|
|
size: 24.0,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|