fix for merge

This commit is contained in:
FlutterFlow 2024-06-17 17:54:07 +00:00
parent 82d0f8fe38
commit d5d22a39ea
3 changed files with 4 additions and 406 deletions

View File

@ -44,8 +44,8 @@
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6436409A27A31CD200820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6436409027A31CDE00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6436409C27A31CD100820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6436409227A31CD300820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -225,8 +225,8 @@
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6436409A27A31CD200820AF7 /* pt */,
6436409027A31CDE00820AF7 /* en */,
6436409C27A31CD100820AF7 /* pt */,
6436409227A31CD300820AF7 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";

View File

@ -1,13 +0,0 @@
import '/flutter_flow/flutter_flow_util.dart';
import 'visit_history_template_component_widget.dart'
show VisitHistoryTemplateComponentWidget;
import 'package:flutter/material.dart';
class VisitHistoryTemplateComponentModel
extends FlutterFlowModel<VisitHistoryTemplateComponentWidget> {
@override
void initState(BuildContext context) {}
@override
void dispose() {}
}

View File

@ -1,389 +0,0 @@
import '/backend/api_requests/api_calls.dart';
import '/components/molecular_components/opt_modal/opt_modal_widget.dart';
import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart';
import '/flutter_flow/flutter_flow_icon_button.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.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:flutter_spinkit/flutter_spinkit.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'visit_history_template_component_model.dart';
export 'visit_history_template_component_model.dart';
class VisitHistoryTemplateComponentWidget extends StatefulWidget {
const VisitHistoryTemplateComponentWidget({
super.key,
this.parameter1,
});
final FFUploadedFile? parameter1;
@override
State<VisitHistoryTemplateComponentWidget> createState() =>
_VisitHistoryTemplateComponentWidgetState();
}
class _VisitHistoryTemplateComponentWidgetState
extends State<VisitHistoryTemplateComponentWidget> {
late VisitHistoryTemplateComponentModel _model;
@override
void setState(VoidCallback callback) {
super.setState(callback);
_model.onUpdate();
}
@override
void initState() {
super.initState();
_model = createModel(context, () => VisitHistoryTemplateComponentModel());
}
@override
void dispose() {
_model.maybeDispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
context.watch<FFAppState>();
return Container(
width: double.infinity,
height: 900.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
FlutterFlowIconButton(
borderColor: Colors.transparent,
borderRadius: 20.0,
borderWidth: 1.0,
buttonSize: 40.0,
icon: Icon(
Icons.settings_sharp,
color: FlutterFlowTheme.of(context).primary,
size: 24.0,
),
onPressed: () async {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
context: context,
builder: (context) {
return Padding(
padding: MediaQuery.viewInsetsOf(context),
child: const OptModalWidget(),
);
},
).then((value) => safeSetState(() {}));
},
),
],
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(14.0),
child: FutureBuilder<ApiCallResponse>(
future: PhpGroup.getVisitsCall.call(
devUUID: FFAppState().devUUID,
userUUID: FFAppState().userUUID,
cliID: FFAppState().cliUUID,
atividade: 'getVisitas',
),
builder: (context, snapshot) {
// Customize what your widget looks like when it's loading.
if (!snapshot.hasData) {
return Center(
child: SizedBox(
width: 50.0,
height: 50.0,
child: SpinKitCircle(
color: FlutterFlowTheme.of(context).primary,
size: 50.0,
),
),
);
}
final gridViewGetVisitsResponse = snapshot.data!;
return Builder(
builder: (context) {
final visitHistory = (PhpGroup.getVisitsCall
.visitasList(
gridViewGetVisitsResponse.jsonBody,
)
?.toList() ??
[])
.take(10)
.toList();
return GridView.builder(
padding: EdgeInsets.zero,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 10.0,
mainAxisSpacing: 10.0,
childAspectRatio: 1.0,
),
scrollDirection: Axis.vertical,
itemCount: visitHistory.length,
itemBuilder: (context, visitHistoryIndex) {
final visitHistoryItem =
visitHistory[visitHistoryIndex];
return Container(
width: double.infinity,
height: double.infinity,
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(50.0),
bottomRight: Radius.circular(50.0),
topLeft: Radius.circular(25.0),
topRight: Radius.circular(25.0),
),
shape: BoxShape.rectangle,
),
child: Stack(
children: [
Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: valueOrDefault<Color>(
() {
if (functions.jsonToStr(getJsonField(
visitHistoryItem,
r'''$.VAW_STATUS''',
)) ==
'\"A\"') {
return FlutterFlowTheme.of(context)
.success;
} else if (functions
.jsonToStr(getJsonField(
visitHistoryItem,
r'''$.VAW_STATUS''',
)) ==
'\"C\"') {
return FlutterFlowTheme.of(context)
.error;
} else if (functions
.jsonToStr(getJsonField(
visitHistoryItem,
r'''$.VAW_STATUS''',
)) ==
'\"I\"') {
return FlutterFlowTheme.of(context)
.warning;
} else {
return FlutterFlowTheme.of(context)
.primary;
}
}(),
FlutterFlowTheme.of(context).primary,
),
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(10.0),
bottomRight: Radius.circular(10.0),
topLeft: Radius.circular(25.0),
topRight: Radius.circular(25.0),
),
shape: BoxShape.rectangle,
),
),
InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () async {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
enableDrag: false,
useSafeArea: true,
context: context,
builder: (context) {
return Padding(
padding:
MediaQuery.viewInsetsOf(context),
child:
VisitDetailsModalTemplateComponentWidget(
visitStatusStr: getJsonField(
visitHistoryItem,
r'''$.VAW_STATUS ''',
).toString(),
visitStartDateStr: getJsonField(
visitHistoryItem,
r'''$.VAW_DTINICIO''',
).toString(),
visitEndDateStr: getJsonField(
visitHistoryItem,
r'''$.VAW_DTFIM''',
).toString(),
visitReasonStr: getJsonField(
visitHistoryItem,
r'''$.MOT_DESCRICAO''',
).toString(),
visitLevelStr: getJsonField(
visitHistoryItem,
r'''$.NAC_DESCRICAO''',
).toString(),
visitTempStr: getJsonField(
visitHistoryItem,
r'''$.VTE_UNICA ''',
).toString(),
visitObsStr: getJsonField(
visitHistoryItem,
r'''$.VAW_OBS''',
).toString(),
visitorImgPath:
valueOrDefault<String>(
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
visitHistoryItem,
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',
),
visitorStrList: getJsonField(
visitHistoryItem,
r'''$.VTE_DOCUMENTO''',
).toString(),
visitIdStr: getJsonField(
visitHistoryItem,
r'''$.VAW_ID''',
).toString(),
visitorJsonList: PhpGroup
.getVisitsCall
.visitasList(
gridViewGetVisitsResponse
.jsonBody,
),
updateToggleIdx: () async {
setState(() {});
},
repeatVisitSchedule: () async {},
),
);
},
).then((value) => safeSetState(() {}));
},
child: ClipRRect(
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: 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(
visitHistoryItem,
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: double.infinity,
height: double.infinity,
fit: BoxFit.cover,
),
),
),
Align(
alignment: const AlignmentDirectional(0.0, -1.0),
child: Container(
width: 200.0,
height: 20.0,
decoration: BoxDecoration(
color: valueOrDefault<Color>(
() {
if (functions.jsonToStr(getJsonField(
visitHistoryItem,
r'''$.VAW_STATUS''',
)) ==
'\"A\"') {
return FlutterFlowTheme.of(context)
.success;
} else if (functions
.jsonToStr(getJsonField(
visitHistoryItem,
r'''$.VAW_STATUS''',
)) ==
'\"C\"') {
return FlutterFlowTheme.of(context)
.error;
} else if (functions
.jsonToStr(getJsonField(
visitHistoryItem,
r'''$.VAW_STATUS''',
)) ==
'\"I\"') {
return FlutterFlowTheme.of(context)
.warning;
} else {
return FlutterFlowTheme.of(context)
.primary;
}
}(),
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),
),
),
alignment: const AlignmentDirectional(0.0, 0.0),
child: Text(
getJsonField(
visitHistoryItem,
r'''$.VTE_NOME''',
).toString(),
textAlign: TextAlign.center,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(context)
.bodyMediumFamily,
color: FlutterFlowTheme.of(context)
.info,
fontSize: 12.0,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
),
),
),
],
),
);
},
);
},
);
},
),
),
),
],
),
);
}
}