From 5383f22dda5ffe6194604585195213247ee16752 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:46:54 +0000 Subject: [PATCH] add acessNotificationModal and accessHistoryPage --- ...76383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg | Bin 0 -> 5963 bytes ios/Runner.xcodeproj/project.pbxproj | 8 +- lib/backend/api_requests/api_calls.dart | 251 +++ .../opt_modal/opt_modal_model.dart | 16 +- .../opt_modal/opt_modal_widget.dart | 240 ++- .../option_selection_modal_widget.dart | 22 +- ..._arrow_linked_locals_component_widget.dart | 18 +- .../menu_component/menu_component_model.dart | 6 +- ...cation_modal_template_component_model.dart | 84 + ...ation_modal_template_component_widget.dart | 426 +++++ ...etails_modal_template_component_model.dart | 2 +- ...tails_modal_template_component_widget.dart | 2 +- .../view_visit_detail_model.dart | 0 .../view_visit_detail_widget.dart | 0 lib/flutter_flow/internationalization.dart | 116 +- lib/flutter_flow/request_manager.dart | 93 + .../acess_history_page_model.dart | 59 + .../acess_history_page_widget.dart | 1676 ++++++----------- ...chedule_provisional_visit_page_widget.dart | 151 +- 19 files changed, 1891 insertions(+), 1279 deletions(-) create mode 100644 assets/images/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg create mode 100644 lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart create mode 100644 lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart rename lib/components/{organism_components => }/view_visit_detail/view_visit_detail_model.dart (100%) rename lib/components/{organism_components => }/view_visit_detail/view_visit_detail_widget.dart (100%) create mode 100644 lib/flutter_flow/request_manager.dart diff --git a/assets/images/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg b/assets/images/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1b53062d3bc61590c8c301a8789ab0e420c44dbc GIT binary patch literal 5963 zcmeI0c~H|y7RNgrBZ?yvqoBx<2?~OSBqSUO5F8D#%B6;g7rIFZham}&gdiX|yUqwA zxHF0ZDikmvg2DnKg8^}rV?+TtBA1|`s9eeo3Yh)<0y<9ZY}NY5RBdh9sdTzufBM_~ zUcY}{tTnIA&M=-_XfQ?;90F%w-h|nyKk00OG z=(V)m2<_)(Yvf_>f_Dkn!twR{OK1>>9_s4O4&}1RUPgA*B{m_H5MBU}BVwXMc>a7L zCB)W9Ax?qDuo-8BRv;p-tj6myeR>11c?NBc~f@M92O*?nXS>n zT_qBUsf1`M2=c)Z$Ye4OZ-z57!$JgBc$hC@hG6+Z14v;BTA@MX2-!h?0U|#E9}R0V zSpu=h*2riHdO=#`=lz@Z@8STjC;|bgq0u(*l(Lf}6!?o_H3r{LL^ZR){gL?tzWXe}F%>Ltf!vH$HOfzjqaS78jQfar~XH@86uq!_9lEU@0^KTg>C| zMO$gq`6u)eu>HI!LXm*YrI5&8B&H>kgEcd^u)vZm$Sf?`fBeUuhvEkg^XvrAlPGL4Q2eF!uT)ZicD09-&Y-u2{teBPU>3yEb=iYAH zTTxl4gJthYqYfc8@*Glf^wWDKD9!NzX{`6pGtIQLvEZB0@u=!$SccuU=JCkJl5BtO zWDmEgfHipJVjUx*Y+EMZ&{emuFrFnfujcIdW#s*JRL}YI_Q!5BzI(54cV%+mM9!>r zdffxktd0w{VoycBeYQc~F=0wom?s)MZ^j3jtE1Sam6pEA(=YUoO%mtoi-Jh4IYy|A zNKJD6!}O8YrzqFnOaDB0wQx1kAtP(wyB5zJy1sQil{1OKSkVHa09YKA&`qdXx4BE| zP3S3eax0$8m0nMy3X*MV0u}^}CJ#gp=SIesJIjF+i^ZL3YIAbU#3ZqjSg?vCdmI4$ zcpAgG$(>eFy*PTv+q#K1y}_=kH8V1!oJcy-Hk9%HE)$13CH#g%okWKCKHb^T|DNXq zQa`E8v~C?z*MuD_oXActksJlU%6yIzOLr=ZKDaD?M^*IOB1iXv4c7;Xf~6kDN!&E= zq_i+Yy-o9~yJz*DRPB;#4aAYy^d>nt=N>la0vGeEFCE*ssNfv-hvi>ns&Pv7iah-vCf+>)4vvJVl_`Mw$0B9UvriH?EY|Z zb*gZ*-gv6$=Y)jl=%*+d8oC`3i6YuyD7`=Ok8J72at#cPVsF~2N1i1+maUps0FA+# zd8^y~nO!-(t48jmc)AC>4Hp~*V8gyCkCVC<0fQ}f3@}zf1DSDc?^eSu!mY1yEU&Na z;pj+zw^WkJphJF}=aviigXZu`w$d5M;<>m8zc`H$R83?9F5 zJi4GuohBc)+Oy&rt1DYp6UI7HHcIv3o*e#1~=L1cEu&eJ`wEu zkzsC9=ee4mBlYF)#F@i#Agh@(p1P@3{M^QIQZ!TK_Bhv|E2g%qJ>z9k;80t2+;rTT zckg;5Ev<a~Q?yk?zZQQHxD z_L&^4pS^fI)?;;bos>4^;mjC(5`Djoay6I8>OC3t>ckD=Oe*nO*_I^{jN_rrl3JVc z1D6(3Q(2ZH?kv$9YG8KYV*Tn~*l~ z>sv_#Y34K%iM)-$7!*M68)DeUDxBTCQYUPSe)1W~F7+)8iny2;L+y3i-FA37-x8m5 zQW`iOnsdtIP=0V{aITB=48vYjzc@3i8$UW9$)pac#L^?%looQqH(7EhuKc$3UcK0~ zCw{x$T3u&X1x&Y?yl{Wph=ypjAs_o>wO5mFkn-BYb*I)Xx@O~~z#A`%WtKK$&nK^~5$)ig@GW+xyAW<;435!kVOF`e zW_^jh`~FN5=w1XumEr2ik@m5_H`X=vCFS23C~mQs9eK`BsA^*4Q^SqV&AHm!tu3^9 zIw0$O?I)_BJJX$MG)J|l!HAq84?%=LbBma0ykt?P*DS-^G8&b-h&-?M=nr2nl?h+$M%8pnQ&TyD004XGNL5 zX0MIal$%$<(nnzliITuPNALpFPTd{n{hrKI;=`tZ99@2I`2cN${?kZsj2T!r8U>tzlkS*0Q9l_EI zM5B z@B|>Vq~Yi5$9LY{1Wmpux>kDr*7)`_@CpF-uO1tY&8;YaNyJqi&T!av#X7|bK!z3H mEtLcNjS7^z&*^TdhW+AAiba(JL!$z_1}6pjKXRJByzO6czK>}D literal 0 HcmV?d00001 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index bb2125b2..c1a93a29 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409427A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409C27A31CD500820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409D27A31CD200820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409627A31CD500820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409427A31CD800820AF7 /* pt */, - 6436409C27A31CD500820AF7 /* en */, + 6436409D27A31CD200820AF7 /* pt */, + 6436409627A31CD500820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 17bf988e..0e524454 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -33,6 +33,7 @@ class PhpGroup { static GetPessoasLocalCall getPessoasLocalCall = GetPessoasLocalCall(); static RespondeSolicitacaoCall respondeSolicitacaoCall = RespondeSolicitacaoCall(); + static GetAccessCall getAccessCall = GetAccessCall(); } class LoginCall { @@ -1552,6 +1553,256 @@ class RespondeSolicitacaoCall { )); } +class GetAccessCall { + Future call({ + String? devUUID = '', + String? userUUID = '', + String? cliID = '', + String? atividade = '', + String? pageSize = '', + String? pageNumber = '', + String? pesTipo = '', + }) async { + final baseUrl = PhpGroup.getBaseUrl(); + + return ApiManager.instance.makeApiCall( + callName: 'getAccess', + apiUrl: '$baseUrl/processRequest.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + 'cliID': cliID, + 'atividade': atividade, + 'pageSize': pageSize, + 'pageNumber': pageNumber, + 'pesTipo': pesTipo, + }, + bodyType: BodyType.X_WWW_FORM_URL_ENCODED, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, + ); + } + + bool? error(dynamic response) => castToType(getJsonField( + response, + r'''$.error''', + )); + int? rows(dynamic response) => castToType(getJsonField( + response, + r'''$.total_rows''', + )); + int? pages(dynamic response) => castToType(getJsonField( + response, + r'''$.total_pages''', + )); + int? page(dynamic response) => castToType(getJsonField( + response, + r'''$.page''', + )); + List? access(dynamic response) => getJsonField( + response, + r'''$.acessos''', + true, + ) as List?; + List? accessDateTime(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].ACE_DATAHORA''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessType(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].ACE_TIPO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessDesc(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].ACI_DESCRICAO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessID(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].ACI_ID''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessMobileNotify(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].ACI_NOTIFICA_MOBILE''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessDestDesc(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].DEST_DESC''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessDestType(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].DEST_TIPO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessDestID(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].DEST_ID''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessDestProID(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].DEST_PRO_ID''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessIdenExternCode(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].IDE_CODEXTERNO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessIdenInternalCode(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].IDE_CODINTERNO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessIdenDesc(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].IDE_DESCRICAO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessIdenID(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].IDE_ID''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessIdenStatus(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].IDE_STATUS''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessIdenUse(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].IDE_USO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessPersonID(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].PES_ID''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessPersonName(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].PES_NOME''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessPersonType(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].PES_TIPO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessDescSet(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].SET_DESCRICAO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessIDSet(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].SET_ID''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? accessTypeSet(dynamic response) => (getJsonField( + response, + r'''$.acessos[:].SET_TIPO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); +} + /// End PHP Group Code class ApiPagingParams { diff --git a/lib/components/molecular_components/opt_modal/opt_modal_model.dart b/lib/components/molecular_components/opt_modal/opt_modal_model.dart index c05b8e19..30a496a6 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_model.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_model.dart @@ -3,9 +3,23 @@ import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; class OptModalModel extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode; + TextEditingController? textController; + String? Function(BuildContext, String?)? textControllerValidator; + // State field(s) for CheckboxListTile widget. + bool? checkboxListTileValue1; + // State field(s) for CheckboxListTile widget. + bool? checkboxListTileValue2; + @override void initState(BuildContext context) {} @override - void dispose() {} + void dispose() { + textFieldFocusNode?.dispose(); + textController?.dispose(); + } } diff --git a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart index 536c2e80..fc9f496e 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart @@ -1,6 +1,8 @@ import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'opt_modal_model.dart'; export 'opt_modal_model.dart'; @@ -24,6 +26,9 @@ class _OptModalWidgetState extends State { void initState() { super.initState(); _model = createModel(context, () => OptModalModel()); + + _model.textController ??= TextEditingController(); + _model.textFieldFocusNode ??= FocusNode(); } @override @@ -36,9 +41,9 @@ class _OptModalWidgetState extends State { @override Widget build(BuildContext context) { return Align( - alignment: const AlignmentDirectional(0.0, 1.0), + alignment: const AlignmentDirectional(1.0, -1.0), child: Container( - width: double.infinity, + width: 300.0, height: 400.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, @@ -53,14 +58,241 @@ class _OptModalWidgetState extends State { Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), child: Icon( - Icons.settings, + Icons.filter_list, color: FlutterFlowTheme.of(context).primary, size: 24.0, ), ), ], ), - ], + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + '0enrtljz' /* Label here... */, + ), + labelStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + 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: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).alternate, + width: 2.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: const Icon( + Icons.search_outlined, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + validator: _model.textControllerValidator.asValidator(context), + ), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Text( + FFLocalizations.of(context).getText( + 'l7tw8b92' /* Tipo de Pessoa */, + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ].addToStart(const SizedBox(width: 24.0)), + ), + Theme( + data: ThemeData( + checkboxTheme: CheckboxThemeData( + visualDensity: VisualDensity.compact, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25), + ), + ), + unselectedWidgetColor: + FlutterFlowTheme.of(context).secondaryText, + ), + child: CheckboxListTile( + value: _model.checkboxListTileValue1 ??= true, + onChanged: (newValue) async { + setState(() => _model.checkboxListTileValue1 = newValue!); + }, + title: Text( + FFLocalizations.of(context).getText( + 'dkvmdln1' /* Title */, + ), + style: FlutterFlowTheme.of(context).titleLarge.override( + fontFamily: + FlutterFlowTheme.of(context).titleLargeFamily, + fontSize: 10.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleLargeFamily), + ), + ), + tileColor: FlutterFlowTheme.of(context).secondaryBackground, + activeColor: FlutterFlowTheme.of(context).primary, + checkColor: FlutterFlowTheme.of(context).info, + dense: true, + controlAffinity: ListTileControlAffinity.leading, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + ), + ), + ] + .addToStart(const SizedBox(height: 10.0)) + .addToEnd(const SizedBox(height: 10.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Text( + FFLocalizations.of(context).getText( + 'pepv7gl9' /* Tipo de Acesso */, + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ].addToStart(const SizedBox(width: 24.0)), + ), + Theme( + data: ThemeData( + checkboxTheme: CheckboxThemeData( + visualDensity: VisualDensity.compact, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25), + ), + ), + unselectedWidgetColor: + FlutterFlowTheme.of(context).secondaryText, + ), + child: CheckboxListTile( + value: _model.checkboxListTileValue2 ??= true, + onChanged: (newValue) async { + setState(() => _model.checkboxListTileValue2 = newValue!); + }, + title: Text( + FFLocalizations.of(context).getText( + 'qos4r9fy' /* Title */, + ), + style: FlutterFlowTheme.of(context).titleLarge.override( + fontFamily: + FlutterFlowTheme.of(context).titleLargeFamily, + fontSize: 10.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleLargeFamily), + ), + ), + tileColor: FlutterFlowTheme.of(context).secondaryBackground, + activeColor: FlutterFlowTheme.of(context).primary, + checkColor: FlutterFlowTheme.of(context).info, + dense: true, + controlAffinity: ListTileControlAffinity.leading, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + ), + ), + ] + .addToStart(const SizedBox(height: 10.0)) + .addToEnd(const SizedBox(height: 10.0)), + ), + FFButtonWidget( + onPressed: () { + print('Button pressed ...'); + }, + text: '', + icon: const Icon( + Icons.done, + size: 15.0, + ), + options: FFButtonOptions( + height: 40.0, + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + 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, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 10.0)) + .addToEnd(const SizedBox(height: 10.0)), ), ), ); diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart index 8934492b..e05bc98b 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart @@ -197,7 +197,16 @@ Rapida */ onTap: () async { Navigator.pop(context); - context.pushNamed('scheduleProvisionalVisitPage'); + context.pushNamed( + 'scheduleProvisionalVisitPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); }, child: Container( width: 100.0, @@ -307,7 +316,16 @@ Provisória */ onTap: () async { Navigator.pop(context); - context.pushNamed('scheduleCompleteVisitPage'); + context.pushNamed( + 'scheduleCompleteVisitPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); }, child: Container( width: 100.0, diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart index 7637f47f..e7c7b164 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -99,16 +99,14 @@ class _BottomArrowLinkedLocalsComponentWidgetState final gridViewGetLocalsResponse = snapshot.data!; return Builder( builder: (context) { - final eachLocals = (PhpGroup.getLocalsCall - .locais( - gridViewGetLocalsResponse.jsonBody, - ) - ?.map((e) => e) - .toList() - .toList() ?? - []) - .take(2) - .toList(); + final eachLocals = PhpGroup.getLocalsCall + .locais( + gridViewGetLocalsResponse.jsonBody, + ) + ?.map((e) => e) + .toList() + .toList() ?? + []; return GridView.builder( padding: EdgeInsets.zero, gridDelegate: diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart index 4a8ac52e..86868ce2 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -57,7 +57,8 @@ class MenuComponentModel extends FlutterFlowModel { extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, - transitionType: PageTransitionType.fade, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, ), }, ); @@ -69,7 +70,8 @@ class MenuComponentModel extends FlutterFlowModel { extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, - transitionType: PageTransitionType.fade, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, ), }, ); diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart new file mode 100644 index 00000000..9318a07c --- /dev/null +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart @@ -0,0 +1,84 @@ +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'access_notification_modal_template_component_widget.dart' + show AccessNotificationModalTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class AccessNotificationModalTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode1; + TextEditingController? textController1; + String? Function(BuildContext, String?)? textController1Validator; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode2; + TextEditingController? textController2; + String? Function(BuildContext, String?)? textController2Validator; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode3; + TextEditingController? textController3; + String? Function(BuildContext, String?)? textController3Validator; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode4; + TextEditingController? textController4; + String? Function(BuildContext, String?)? textController4Validator; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode5; + TextEditingController? textController5; + String? Function(BuildContext, String?)? textController5Validator; + + @override + void initState(BuildContext context) {} + + @override + void dispose() { + textFieldFocusNode1?.dispose(); + textController1?.dispose(); + + textFieldFocusNode2?.dispose(); + textController2?.dispose(); + + textFieldFocusNode3?.dispose(); + textController3?.dispose(); + + textFieldFocusNode4?.dispose(); + textController4?.dispose(); + + textFieldFocusNode5?.dispose(); + textController5?.dispose(); + } + + /// Action blocks. + Future visitRequestComponentAction( + BuildContext context, { + required String? actionValue, + required String? refUUID, + required String? responseValue, + required String? vteUUID, + }) async { + ApiCallResponse? visitRequest; + + visitRequest = await PhpGroup.respondeSolicitacaoCall.call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'respondeSolicitacao', + referencia: refUUID, + tarefa: actionValue, + resposta: responseValue, + idVisitante: vteUUID, + ); + + if (PhpGroup.respondeSolicitacaoCall.error( + (visitRequest.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + return true; + } else { + return false; + } + } +} diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart new file mode 100644 index 00000000..ee10a48e --- /dev/null +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart @@ -0,0 +1,426 @@ +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +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 'access_notification_modal_template_component_model.dart'; +export 'access_notification_modal_template_component_model.dart'; + +class AccessNotificationModalTemplateComponentWidget extends StatefulWidget { + const AccessNotificationModalTemplateComponentWidget({ + super.key, + required this.name, + required this.type, + required this.datetime, + required this.id, + required this.drive, + }); + + final String? name; + final String? type; + final String? datetime; + final String? id; + final String? drive; + + @override + State createState() => + _AccessNotificationModalTemplateComponentWidgetState(); +} + +class _AccessNotificationModalTemplateComponentWidgetState + extends State { + late AccessNotificationModalTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel( + context, () => AccessNotificationModalTemplateComponentModel()); + + _model.textController1 ??= TextEditingController(text: widget.name); + _model.textFieldFocusNode1 ??= FocusNode(); + + _model.textController2 ??= TextEditingController(text: widget.type); + _model.textFieldFocusNode2 ??= FocusNode(); + + _model.textController3 ??= TextEditingController(text: widget.id); + _model.textFieldFocusNode3 ??= FocusNode(); + + _model.textController4 ??= TextEditingController(text: widget.datetime); + _model.textFieldFocusNode4 ??= FocusNode(); + + _model.textController5 ??= TextEditingController(text: widget.drive); + _model.textFieldFocusNode5 ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.9, + 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: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 150.0, + height: 150.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 100), + fadeOutDuration: const Duration(milliseconds: 100), + imageUrl: valueOrDefault( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + ] + .addToStart(const SizedBox(width: 10.0)) + .addToEnd(const SizedBox(width: 10.0)), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + textInputAction: TextInputAction.next, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'dvag09pq' /* 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: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + 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), + ), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: + _model.textController1Validator.asValidator(context), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autofocus: false, + textInputAction: TextInputAction.next, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'h3s0r1he' /* Tipo */, + ), + 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: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.merge_type, + 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), + ), + textAlign: TextAlign.center, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController2Validator + .asValidator(context), + ), + ), + Expanded( + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.next, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'vjd9uwla' /* Identificador */, + ), + 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: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.grid_3x3, + 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), + ), + textAlign: TextAlign.center, + validator: _model.textController3Validator + .asValidator(context), + ), + ), + ] + .addToStart(const SizedBox(width: 24.0)) + .addToEnd(const SizedBox(width: 24.0)), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, + autofocus: false, + textInputAction: TextInputAction.next, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'jveeqpdz' /* 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), + ), + 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: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.history_edu, + 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), + ), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: + _model.textController4Validator.asValidator(context), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController5, + focusNode: _model.textFieldFocusNode5, + autofocus: false, + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.next, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + '9jdmuak2' /* Acionamento */, + ), + 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: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.message, + 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), + ), + textAlign: TextAlign.start, + validator: + _model.textController5Validator.asValidator(context), + ), + ), + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 20.0)) + .addToEnd(const SizedBox(height: 20.0)), + ), + ), + ), + ), + ); + } +} diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index 66a54d4a..f305c4de 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,5 +1,5 @@ import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/organism_components/view_visit_detail/view_visit_detail_widget.dart'; +import '/components/view_visit_detail/view_visit_detail_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'visit_details_modal_template_component_widget.dart' show VisitDetailsModalTemplateComponentWidget; diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index f964b9b1..889c76c2 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,5 +1,5 @@ import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/organism_components/view_visit_detail/view_visit_detail_widget.dart'; +import '/components/view_visit_detail/view_visit_detail_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'visit_details_modal_template_component_model.dart'; diff --git a/lib/components/organism_components/view_visit_detail/view_visit_detail_model.dart b/lib/components/view_visit_detail/view_visit_detail_model.dart similarity index 100% rename from lib/components/organism_components/view_visit_detail/view_visit_detail_model.dart rename to lib/components/view_visit_detail/view_visit_detail_model.dart diff --git a/lib/components/organism_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/view_visit_detail/view_visit_detail_widget.dart similarity index 100% rename from lib/components/organism_components/view_visit_detail/view_visit_detail_widget.dart rename to lib/components/view_visit_detail/view_visit_detail_widget.dart diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index f61558cc..9e8be8f3 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -336,14 +336,6 @@ final kTranslationsMap = >>[ }, // scheduleProvisionalVisitPage { - 'n7bbd202': { - 'pt': 'Agendamento Provisório', - 'en': 'Provisional Scheduling', - }, - 'i4xujgbn': { - 'pt': 'Visita Provisória', - 'en': 'Provisional Visit', - }, 'x7at46ur': { 'pt': 'Quais visitantes você deseja cadastrar?', 'en': 'Which visitors do you want to register?', @@ -384,6 +376,10 @@ final kTranslationsMap = >>[ 'pt': 'Escreva as suas observações aqui', 'en': 'Write your observations here', }, + 'cifgwfxs': { + 'pt': 'Agendamento Provisório', + 'en': 'Provisional Scheduling', + }, 'lhzhh2jb': { 'pt': 'scheduleVisit', 'en': '', @@ -406,49 +402,41 @@ final kTranslationsMap = >>[ 'pt': 'Visitantes', 'en': 'Visitors', }, - 'nhxs49l9': { - 'pt': 'Visitante: ', - 'en': 'Visitor:', + '26dznyam': { + 'pt': 'Entrou: ', + 'en': 'Access:', }, - 'x9jg3kfx': { - 'pt': 'Início em: ', - 'en': 'Beginning in:', - }, - 'dh8ib64e': { - 'pt': 'Fim em: ', - 'en': 'End in:', + 'f2vfwn36': { + 'pt': 'Setor', + 'en': 'Drive:', }, '1qa1ok6g': { 'pt': 'Todos', 'en': 'All', }, - 'ftl6katl': { - 'pt': 'Visitante: ', - 'en': 'Visitor:', + 'kf5m85d2': { + 'pt': 'Entrou: ', + 'en': 'Access:', }, - 'dbquxozy': { - 'pt': 'Início em: ', - 'en': 'Beginning in:', - }, - 'gjw5vcc6': { - 'pt': 'Fim em: ', - 'en': 'End in:', + 'dxvbfe8h': { + 'pt': 'Setor', + 'en': 'Drive:', }, 'rvac7h59': { 'pt': 'Moradores', 'en': 'Residents', }, - '0xbh5f3a': { - 'pt': 'Visitante: ', - 'en': 'Visitor:', + '5thshl66': { + 'pt': 'Entrou: ', + 'en': 'Access:', }, - 'gq3pp39j': { - 'pt': 'Início em: ', - 'en': 'Beginning in:', + 'd13i2fmk': { + 'pt': 'Setor', + 'en': 'Drive:', }, - '7iaxwb8o': { - 'pt': 'Fim em: ', - 'en': 'End in:', + 'ch8qymga': { + 'pt': 'Histórico de Acesso', + 'en': 'Access History', }, '5uzkio93': { 'pt': 'Home', @@ -518,6 +506,29 @@ final kTranslationsMap = >>[ 'en': 'Email', }, }, + // optModal + { + '0enrtljz': { + 'pt': 'Label here...', + 'en': '', + }, + 'l7tw8b92': { + 'pt': 'Tipo de Pessoa', + 'en': '', + }, + 'dkvmdln1': { + 'pt': 'Title', + 'en': '', + }, + 'pepv7gl9': { + 'pt': 'Tipo de Acesso', + 'en': '', + }, + 'qos4r9fy': { + 'pt': 'Title', + 'en': '', + }, + }, // throwException { 'e58xxxiq': { @@ -995,6 +1006,37 @@ final kTranslationsMap = >>[ 'en': '', }, }, + // accessNotificationModalTemplateComponent + { + 'dvag09pq': { + 'pt': 'Nome', + 'en': 'Name', + }, + 'h3s0r1he': { + 'pt': 'Tipo', + 'en': 'Type', + }, + 'vjd9uwla': { + 'pt': 'Identificador', + 'en': 'Identifier', + }, + 's3nix1ot': { + 'pt': '', + 'en': '', + }, + 'jveeqpdz': { + 'pt': 'Acesso', + 'en': 'Access', + }, + '9jdmuak2': { + 'pt': 'Acionamento', + 'en': 'Drive', + }, + '5qdmkvw3': { + 'pt': '', + 'en': '', + }, + }, // Miscellaneous { 'i5smty81': { diff --git a/lib/flutter_flow/request_manager.dart b/lib/flutter_flow/request_manager.dart new file mode 100644 index 00000000..f26ed03b --- /dev/null +++ b/lib/flutter_flow/request_manager.dart @@ -0,0 +1,93 @@ +// ignore_for_file: close_sinks + +import 'dart:async'; + +import 'package:rxdart/rxdart.dart'; +import 'package:rxdart/subjects.dart'; + +class FutureRequestManager { + FutureRequestManager([this.cacheLimit = 10]); + + final int cacheLimit; + final Map> _requests = {}; + Future performRequest({ + String? uniqueQueryKey, + bool? overrideCache, + required Future Function() requestFn, + }) { + uniqueQueryKey = _requestKey(uniqueQueryKey); + overrideCache ??= false; + + // If we don't want to use the cache, clear it for this request. + if (overrideCache) { + clearRequest(uniqueQueryKey); + } + // Remove the first cached result if we have reached the specified limit, + // since we will be adding another. + if (!_requests.containsKey(uniqueQueryKey) && + _requests.length >= cacheLimit) { + _requests.remove(_requests.keys.first); + } + // Return the cached query result or set it to the new value. + return _requests[uniqueQueryKey] ??= requestFn(); + } + + void clearRequest(String? key) => _requests.remove(_requestKey(key)); + + void clear() => _requests.keys.toList().forEach(clearRequest); +} + +class StreamRequestManager { + StreamRequestManager([this.cacheLimit = 10]); + + final int cacheLimit; + final Map> _streamSubjects = {}; + final Map> _requestSubscriptions = {}; + Stream performRequest({ + String? uniqueQueryKey, + bool? overrideCache, + required Stream Function() requestFn, + }) { + uniqueQueryKey = _requestKey(uniqueQueryKey); + overrideCache ??= false; + + // If we don't want to use the cache, clear it for this request. + if (overrideCache) { + clearRequest(uniqueQueryKey); + } + + // If this request was made previously, return its value stream. + if (_streamSubjects.containsKey(uniqueQueryKey)) { + return _streamSubjects[uniqueQueryKey]!.stream; + } + + // Remove the first cached result if we have reached the specified limit, + // since we will be adding another. + if (_streamSubjects.isNotEmpty && _streamSubjects.length >= cacheLimit) { + clearRequest(_streamSubjects.keys.first); + } + + // Create a subscription that stores the latest result in the behavior subject. + final streamSubject = BehaviorSubject(); + _requestSubscriptions[uniqueQueryKey] = requestFn() + .asBroadcastStream() + .listen((result) => streamSubject.add(result)); + _streamSubjects[uniqueQueryKey] = streamSubject; + + return streamSubject.stream; + } + + void clearRequest(String? key) { + key = _requestKey(key); + _streamSubjects.remove(key)?.close(); + _requestSubscriptions.remove(key)?.cancel(); + } + + void clear() => { + ..._streamSubjects.keys, + ..._requestSubscriptions.keys, + }.forEach(clearRequest); +} + +String _requestKey(String? key) => + key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart index 79f51b52..e08cfb0f 100644 --- a/lib/pages/acess_history_page/acess_history_page_model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -1,4 +1,7 @@ +import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/request_manager.dart'; + import 'acess_history_page_widget.dart' show AcessHistoryPageWidget; import 'package:flutter/material.dart'; @@ -11,6 +14,54 @@ class AcessHistoryPageModel extends FlutterFlowModel { int get tabBarCurrentIndex => tabBarController != null ? tabBarController!.index : 0; + /// Query cache managers for this widget. + + final _visitorsAcessHistoryManager = FutureRequestManager(); + Future visitorsAcessHistory({ + String? uniqueQueryKey, + bool? overrideCache, + required Future Function() requestFn, + }) => + _visitorsAcessHistoryManager.performRequest( + uniqueQueryKey: uniqueQueryKey, + overrideCache: overrideCache, + requestFn: requestFn, + ); + void clearVisitorsAcessHistoryCache() => _visitorsAcessHistoryManager.clear(); + void clearVisitorsAcessHistoryCacheKey(String? uniqueKey) => + _visitorsAcessHistoryManager.clearRequest(uniqueKey); + + final _residentsAcessHistoryManager = FutureRequestManager(); + Future residentsAcessHistory({ + String? uniqueQueryKey, + bool? overrideCache, + required Future Function() requestFn, + }) => + _residentsAcessHistoryManager.performRequest( + uniqueQueryKey: uniqueQueryKey, + overrideCache: overrideCache, + requestFn: requestFn, + ); + void clearResidentsAcessHistoryCache() => + _residentsAcessHistoryManager.clear(); + void clearResidentsAcessHistoryCacheKey(String? uniqueKey) => + _residentsAcessHistoryManager.clearRequest(uniqueKey); + + final _accessHistoryManager = FutureRequestManager(); + Future accessHistory({ + String? uniqueQueryKey, + bool? overrideCache, + required Future Function() requestFn, + }) => + _accessHistoryManager.performRequest( + uniqueQueryKey: uniqueQueryKey, + overrideCache: overrideCache, + requestFn: requestFn, + ); + void clearAccessHistoryCache() => _accessHistoryManager.clear(); + void clearAccessHistoryCacheKey(String? uniqueKey) => + _accessHistoryManager.clearRequest(uniqueKey); + @override void initState(BuildContext context) {} @@ -18,5 +69,13 @@ class AcessHistoryPageModel extends FlutterFlowModel { void dispose() { unfocusNode.dispose(); tabBarController?.dispose(); + + /// Dispose query cache managers for this widget. + + clearVisitorsAcessHistoryCache(); + + clearResidentsAcessHistoryCache(); + + clearAccessHistoryCache(); } } diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart index 395663af..d03d0750 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -1,9 +1,8 @@ import '/backend/api_requests/api_calls.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'; @@ -54,6 +53,40 @@ class _AcessHistoryPageWidgetState extends State child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + 'ch8qymga' /* Histórico de Acesso */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 22.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), + ), + actions: const [], + centerTitle: true, + elevation: 2.0, + ), body: SafeArea( top: true, child: Column( @@ -111,11 +144,16 @@ class _AcessHistoryPageWidgetState extends State height: double.infinity, decoration: const BoxDecoration(), child: FutureBuilder( - future: PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', + future: _model.visitorsAcessHistory( + requestFn: () => PhpGroup.getAccessCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getAcessos', + pageSize: '100', + pageNumber: '1', + pesTipo: 'E', + ), ), builder: (context, snapshot) { // Customize what your widget looks like when it's loading. @@ -132,15 +170,17 @@ class _AcessHistoryPageWidgetState extends State ), ); } - final wrapGetVisitsResponse = snapshot.data!; + final wrapGetAccessResponse = snapshot.data!; return Builder( builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []; + final visitorsAccess = + PhpGroup.getAccessCall + .access( + wrapGetAccessResponse + .jsonBody, + ) + ?.toList() ?? + []; return Wrap( spacing: 2.0, runSpacing: 1.0, @@ -151,207 +191,148 @@ class _AcessHistoryPageWidgetState extends State runAlignment: WrapAlignment.start, verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, - children: List.generate(visitaWrap.length, - (visitaWrapIndex) { - final visitaWrapItem = - visitaWrap[visitaWrapIndex]; + children: + List.generate(visitorsAccess.length, + (visitorsAccessIndex) { + final visitorsAccessItem = + visitorsAccess[visitorsAccessIndex]; return Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: 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 GestureDetector( - onTap: () => _model - .unfocusNode - .canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model - .unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - VisitDetailsModalTemplateComponentWidget( - visitStatusStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString(), - visitStartDateStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - visitEndDateStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - visitReasonStr: - getJsonField( - visitaWrapItem, - r'''$.MOT_DESCRICAO''', - ).toString(), - visitLevelStr: - getJsonField( - visitaWrapItem, - r'''$.NAC_DESCRICAO''', - ).toString(), - visitTempStr: - getJsonField( - visitaWrapItem, - r'''$.VTE_UNICA''', - ).toString(), - visitObsStr: - getJsonField( - visitaWrapItem, - 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( - visitaWrapItem, - 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( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString(), - visitIdStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_ID''', - ).toString(), - visitorJsonList: - PhpGroup - .getVisitsCall - .visitasList( - wrapGetVisitsResponse - .jsonBody, - ), - updateToggleIdx: - () async {}, - repeatVisitSchedule: - () async {}, - ), - ), - ); - }, - ).then((value) => - safeSetState(() {})); - }, - child: Card( - clipBehavior: - Clip.antiAliasWithSaveLayer, - color: - FlutterFlowTheme.of(context) - .secondaryBackground, - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(8.0), + child: Card( + clipBehavior: + Clip.antiAliasWithSaveLayer, + color: FlutterFlowTheme.of(context) + .secondaryBackground, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 128.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .secondaryBackground, ), - child: Container( - width: 350.0, - height: 115.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: - const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.all( + 10.0), + child: ClipRRect( + borderRadius: + BorderRadius + .circular( + 100.0), + child: Image.asset( + 'assets/images/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + width: 60.0, + height: 60.0, + fit: BoxFit.cover, + ), + ), + ), + Column( + mainAxisSize: + MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + getJsonField( + visitorsAccessItem, + r'''$.PES_NOME''', + ).toString(), + style: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Container( + width: 100.0, + height: 25.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme + .of(context) + .warning, + borderRadius: + BorderRadius + .circular( + 24.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + getJsonField( + visitorsAccessItem, + r'''$.PES_TIPO''', + ).toString(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of( + context) + .info, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ] + .divide(const SizedBox( + width: 20.0)) + .addToStart(const SizedBox( + width: 5.0)) + .addToEnd(const SizedBox( + width: 5.0)), + ), + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Expanded( child: Column( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - 'nhxs49l9' /* Visitante: */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: - 12.5, - letterSpacing: - 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, - -1.0), - child: Text( - getJsonField( - visitaWrapItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: - 12.5, - letterSpacing: - 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ].addToStart( - const SizedBox( - width: - 10.0)), - ), Row( mainAxisSize: MainAxisSize @@ -364,7 +345,7 @@ class _AcessHistoryPageWidgetState extends State FFLocalizations.of( context) .getText( - 'x9jg3kfx' /* Início em: */, + '26dznyam' /* Entrou: */, ), style: FlutterFlowTheme.of( context) @@ -384,8 +365,8 @@ class _AcessHistoryPageWidgetState extends State ), Text( getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', + visitorsAccessItem, + r'''$.ACE_DATAHORA''', ).toString(), style: FlutterFlowTheme.of( context) @@ -418,7 +399,7 @@ class _AcessHistoryPageWidgetState extends State FFLocalizations.of( context) .getText( - 'dh8ib64e' /* Fim em: */, + 'f2vfwn36' /* Setor */, ), style: FlutterFlowTheme.of( context) @@ -438,8 +419,8 @@ class _AcessHistoryPageWidgetState extends State ), Text( getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', + visitorsAccessItem, + r'''$.ACI_DESCRICAO''', ).toString(), style: FlutterFlowTheme.of( context) @@ -460,168 +441,17 @@ class _AcessHistoryPageWidgetState extends State width: 10.0)), ), - Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 200.0, - height: 27.0, - decoration: - BoxDecoration( - color: valueOrDefault< - Color>( - () { - if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme.of(context) - .success; - } else if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') { - return FlutterFlowTheme.of(context) - .error; - } else if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme.of(context) - .warning; - } else { - return FlutterFlowTheme.of(context) - .primary; - } - }(), - FlutterFlowTheme.of( - context) - .primary, - ), - borderRadius: - BorderRadius.circular( - 5.0), - ), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - () { - if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Ativo', - enText: - 'Active', - ); - } else if ((functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Cancelado', - enText: - 'Canceled', - ); - } else { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Pendente', - enText: - 'Pending', - ); - } - }(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: - FlutterFlowTheme.of(context).info, - letterSpacing: - 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - ), - ), ].divide(const SizedBox( height: 3.0)), ), ), - ), - ClipRRect( - borderRadius: - BorderRadius.circular( - 0.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( - visitaWrapItem, - 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', - ), - fit: BoxFit.cover, - ), - ), - ], - ), + ] + .addToStart(const SizedBox( + width: 5.0)) + .addToEnd(const SizedBox( + width: 5.0)), + ), + ], ), ), ), @@ -640,17 +470,52 @@ class _AcessHistoryPageWidgetState extends State mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ + Container( + width: double.infinity, + height: 38.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.filter_list, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + onPressed: () { + print('IconButton pressed ...'); + }, + ), + ] + .addToStart(const SizedBox(width: 10.0)) + .addToEnd(const SizedBox(width: 10.0)), + ), + ), Expanded( child: Container( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), child: FutureBuilder( - future: PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', + future: _model.accessHistory( + requestFn: () => PhpGroup.getAccessCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getAcessos', + pageSize: '100', + pageNumber: '1', + pesTipo: 'T', + ), ), builder: (context, snapshot) { // Customize what your widget looks like when it's loading. @@ -667,12 +532,12 @@ class _AcessHistoryPageWidgetState extends State ), ); } - final wrapGetVisitsResponse = snapshot.data!; + final wrapGetAccessResponse = snapshot.data!; return Builder( builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, + final accessHistory = PhpGroup.getAccessCall + .access( + wrapGetAccessResponse.jsonBody, ) ?.toList() ?? []; @@ -686,207 +551,157 @@ class _AcessHistoryPageWidgetState extends State runAlignment: WrapAlignment.start, verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, - children: List.generate(visitaWrap.length, - (visitaWrapIndex) { - final visitaWrapItem = - visitaWrap[visitaWrapIndex]; + children: + List.generate(accessHistory.length, + (accessHistoryIndex) { + final accessHistoryItem = + accessHistory[accessHistoryIndex]; return Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: 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 GestureDetector( - onTap: () => _model - .unfocusNode - .canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model - .unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - VisitDetailsModalTemplateComponentWidget( - visitStatusStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString(), - visitStartDateStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - visitEndDateStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - visitReasonStr: - getJsonField( - visitaWrapItem, - r'''$.MOT_DESCRICAO''', - ).toString(), - visitLevelStr: - getJsonField( - visitaWrapItem, - r'''$.NAC_DESCRICAO''', - ).toString(), - visitTempStr: - getJsonField( - visitaWrapItem, - r'''$.VTE_UNICA''', - ).toString(), - visitObsStr: - getJsonField( - visitaWrapItem, - 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( - visitaWrapItem, - 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( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString(), - visitIdStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_ID''', - ).toString(), - visitorJsonList: - PhpGroup - .getVisitsCall - .visitasList( - wrapGetVisitsResponse - .jsonBody, - ), - updateToggleIdx: - () async {}, - repeatVisitSchedule: - () async {}, - ), - ), - ); - }, - ).then((value) => - safeSetState(() {})); - }, - child: Card( - clipBehavior: - Clip.antiAliasWithSaveLayer, - color: - FlutterFlowTheme.of(context) - .secondaryBackground, - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(8.0), + child: Card( + clipBehavior: + Clip.antiAliasWithSaveLayer, + color: FlutterFlowTheme.of(context) + .secondaryBackground, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 128.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .secondaryBackground, ), - child: Container( - width: 350.0, - height: 115.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: - const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.all( + 10.0), + child: ClipRRect( + borderRadius: + BorderRadius + .circular( + 100.0), + child: Image.asset( + 'assets/images/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + width: 60.0, + height: 60.0, + fit: BoxFit.cover, + ), + ), + ), + Column( + mainAxisSize: + MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + getJsonField( + accessHistoryItem, + r'''$.PES_NOME''', + ).toString(), + style: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Container( + width: 100.0, + height: 25.0, + decoration: + BoxDecoration( + color: functions.jsonToStr( + getJsonField( + accessHistoryItem, + r'''$.PES_TIPO''', + )) == + 'E' + ? FlutterFlowTheme.of( + context) + .primary + : FlutterFlowTheme.of( + context) + .warning, + borderRadius: + BorderRadius + .circular( + 24.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + getJsonField( + accessHistoryItem, + r'''$.PES_TIPO''', + ).toString(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of( + context) + .info, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ] + .divide(const SizedBox( + width: 20.0)) + .addToStart(const SizedBox( + width: 5.0)) + .addToEnd(const SizedBox( + width: 5.0)), + ), + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Expanded( child: Column( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - 'ftl6katl' /* Visitante: */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: - 12.5, - letterSpacing: - 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, - -1.0), - child: Text( - getJsonField( - visitaWrapItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: - 12.5, - letterSpacing: - 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ].addToStart( - const SizedBox( - width: - 10.0)), - ), Row( mainAxisSize: MainAxisSize @@ -899,7 +714,7 @@ class _AcessHistoryPageWidgetState extends State FFLocalizations.of( context) .getText( - 'dbquxozy' /* Início em: */, + 'kf5m85d2' /* Entrou: */, ), style: FlutterFlowTheme.of( context) @@ -919,8 +734,8 @@ class _AcessHistoryPageWidgetState extends State ), Text( getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', + accessHistoryItem, + r'''$.ACE_DATAHORA''', ).toString(), style: FlutterFlowTheme.of( context) @@ -953,7 +768,7 @@ class _AcessHistoryPageWidgetState extends State FFLocalizations.of( context) .getText( - 'gjw5vcc6' /* Fim em: */, + 'dxvbfe8h' /* Setor */, ), style: FlutterFlowTheme.of( context) @@ -973,8 +788,8 @@ class _AcessHistoryPageWidgetState extends State ), Text( getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', + accessHistoryItem, + r'''$.ACI_DESCRICAO''', ).toString(), style: FlutterFlowTheme.of( context) @@ -995,168 +810,17 @@ class _AcessHistoryPageWidgetState extends State width: 10.0)), ), - Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 200.0, - height: 27.0, - decoration: - BoxDecoration( - color: valueOrDefault< - Color>( - () { - if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme.of(context) - .success; - } else if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') { - return FlutterFlowTheme.of(context) - .error; - } else if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme.of(context) - .warning; - } else { - return FlutterFlowTheme.of(context) - .primary; - } - }(), - FlutterFlowTheme.of( - context) - .primary, - ), - borderRadius: - BorderRadius.circular( - 5.0), - ), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - () { - if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Ativo', - enText: - 'Active', - ); - } else if ((functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Cancelado', - enText: - 'Canceled', - ); - } else { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Pendente', - enText: - 'Pending', - ); - } - }(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: - FlutterFlowTheme.of(context).info, - letterSpacing: - 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - ), - ), ].divide(const SizedBox( height: 3.0)), ), ), - ), - ClipRRect( - borderRadius: - BorderRadius.circular( - 0.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( - visitaWrapItem, - 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', - ), - fit: BoxFit.cover, - ), - ), - ], - ), + ] + .addToStart(const SizedBox( + width: 5.0)) + .addToEnd(const SizedBox( + width: 5.0)), + ), + ], ), ), ), @@ -1169,7 +833,7 @@ class _AcessHistoryPageWidgetState extends State ), ), ), - ].addToStart(const SizedBox(height: 30.0)), + ].addToStart(const SizedBox(height: 5.0)), ), Column( mainAxisSize: MainAxisSize.max, @@ -1181,11 +845,16 @@ class _AcessHistoryPageWidgetState extends State height: double.infinity, decoration: const BoxDecoration(), child: FutureBuilder( - future: PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', + future: _model.residentsAcessHistory( + requestFn: () => PhpGroup.getAccessCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getAcessos', + pageSize: '100', + pageNumber: '1', + pesTipo: 'O', + ), ), builder: (context, snapshot) { // Customize what your widget looks like when it's loading. @@ -1202,15 +871,17 @@ class _AcessHistoryPageWidgetState extends State ), ); } - final wrapGetVisitsResponse = snapshot.data!; + final wrapGetAccessResponse = snapshot.data!; return Builder( builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []; + final residentsAccess = + PhpGroup.getAccessCall + .access( + wrapGetAccessResponse + .jsonBody, + ) + ?.toList() ?? + []; return Wrap( spacing: 2.0, runSpacing: 1.0, @@ -1221,207 +892,149 @@ class _AcessHistoryPageWidgetState extends State runAlignment: WrapAlignment.start, verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, - children: List.generate(visitaWrap.length, - (visitaWrapIndex) { - final visitaWrapItem = - visitaWrap[visitaWrapIndex]; + children: + List.generate(residentsAccess.length, + (residentsAccessIndex) { + final residentsAccessItem = + residentsAccess[ + residentsAccessIndex]; return Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: 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 GestureDetector( - onTap: () => _model - .unfocusNode - .canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model - .unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - VisitDetailsModalTemplateComponentWidget( - visitStatusStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString(), - visitStartDateStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - visitEndDateStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - visitReasonStr: - getJsonField( - visitaWrapItem, - r'''$.MOT_DESCRICAO''', - ).toString(), - visitLevelStr: - getJsonField( - visitaWrapItem, - r'''$.NAC_DESCRICAO''', - ).toString(), - visitTempStr: - getJsonField( - visitaWrapItem, - r'''$.VTE_UNICA''', - ).toString(), - visitObsStr: - getJsonField( - visitaWrapItem, - 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( - visitaWrapItem, - 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( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString(), - visitIdStr: - getJsonField( - visitaWrapItem, - r'''$.VAW_ID''', - ).toString(), - visitorJsonList: - PhpGroup - .getVisitsCall - .visitasList( - wrapGetVisitsResponse - .jsonBody, - ), - updateToggleIdx: - () async {}, - repeatVisitSchedule: - () async {}, - ), - ), - ); - }, - ).then((value) => - safeSetState(() {})); - }, - child: Card( - clipBehavior: - Clip.antiAliasWithSaveLayer, - color: - FlutterFlowTheme.of(context) - .secondaryBackground, - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(8.0), + child: Card( + clipBehavior: + Clip.antiAliasWithSaveLayer, + color: FlutterFlowTheme.of(context) + .secondaryBackground, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 128.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .secondaryBackground, ), - child: Container( - width: 350.0, - height: 115.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: - const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.all( + 10.0), + child: ClipRRect( + borderRadius: + BorderRadius + .circular( + 100.0), + child: Image.asset( + 'assets/images/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + width: 60.0, + height: 60.0, + fit: BoxFit.cover, + ), + ), + ), + Column( + mainAxisSize: + MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + getJsonField( + residentsAccessItem, + r'''$.PES_NOME''', + ).toString(), + style: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Container( + width: 100.0, + height: 25.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primary, + borderRadius: + BorderRadius + .circular( + 24.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + getJsonField( + residentsAccessItem, + r'''$.PES_TIPO''', + ).toString(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of( + context) + .info, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ] + .divide(const SizedBox( + width: 20.0)) + .addToStart(const SizedBox( + width: 5.0)) + .addToEnd(const SizedBox( + width: 5.0)), + ), + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Expanded( child: Column( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - '0xbh5f3a' /* Visitante: */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: - 12.5, - letterSpacing: - 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, - -1.0), - child: Text( - getJsonField( - visitaWrapItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: - 12.5, - letterSpacing: - 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ].addToStart( - const SizedBox( - width: - 10.0)), - ), Row( mainAxisSize: MainAxisSize @@ -1434,7 +1047,7 @@ class _AcessHistoryPageWidgetState extends State FFLocalizations.of( context) .getText( - 'gq3pp39j' /* Início em: */, + '5thshl66' /* Entrou: */, ), style: FlutterFlowTheme.of( context) @@ -1454,8 +1067,8 @@ class _AcessHistoryPageWidgetState extends State ), Text( getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', + residentsAccessItem, + r'''$.ACE_DATAHORA''', ).toString(), style: FlutterFlowTheme.of( context) @@ -1488,7 +1101,7 @@ class _AcessHistoryPageWidgetState extends State FFLocalizations.of( context) .getText( - '7iaxwb8o' /* Fim em: */, + 'd13i2fmk' /* Setor */, ), style: FlutterFlowTheme.of( context) @@ -1508,8 +1121,8 @@ class _AcessHistoryPageWidgetState extends State ), Text( getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', + residentsAccessItem, + r'''$.ACI_DESCRICAO''', ).toString(), style: FlutterFlowTheme.of( context) @@ -1530,168 +1143,17 @@ class _AcessHistoryPageWidgetState extends State width: 10.0)), ), - Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 200.0, - height: 27.0, - decoration: - BoxDecoration( - color: valueOrDefault< - Color>( - () { - if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme.of(context) - .success; - } else if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') { - return FlutterFlowTheme.of(context) - .error; - } else if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme.of(context) - .warning; - } else { - return FlutterFlowTheme.of(context) - .primary; - } - }(), - FlutterFlowTheme.of( - context) - .primary, - ), - borderRadius: - BorderRadius.circular( - 5.0), - ), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - () { - if (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Ativo', - enText: - 'Active', - ); - } else if ((functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (functions.jsonToStr(getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Cancelado', - enText: - 'Canceled', - ); - } else { - return FFLocalizations.of(context) - .getVariableText( - ptText: - 'Pendente', - enText: - 'Pending', - ); - } - }(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: - FlutterFlowTheme.of(context).info, - letterSpacing: - 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - ), - ), ].divide(const SizedBox( height: 3.0)), ), ), - ), - ClipRRect( - borderRadius: - BorderRadius.circular( - 0.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( - visitaWrapItem, - 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', - ), - fit: BoxFit.cover, - ), - ), - ], - ), + ] + .addToStart(const SizedBox( + width: 5.0)) + .addToEnd(const SizedBox( + width: 5.0)), + ), + ], ), ), ), diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index 2dd72163..7b83d261 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,6 +1,7 @@ import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_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/flutter_flow_widgets.dart'; @@ -58,110 +59,54 @@ class _ScheduleProvisionalVisitPageWidgetState child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + 'cifgwfxs' /* Agendamento Provisório */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + elevation: 2.0, + ), body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - _model.toggleIdx = true; - setState(() {}); - }, - child: Container( - width: 100.0, - height: 40.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(100.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(100.0), - ), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'n7bbd202' /* Agendamento Provisório */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ], - ), Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), + decoration: const BoxDecoration(), child: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 20.0, 0.0, 20.0), - child: Text( - FFLocalizations.of(context).getText( - 'i4xujgbn' /* Visita Provisória */, - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: 'Nunito', - fontSize: 21.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ), - ], - ), - ), - Divider( - thickness: 0.5, - color: FlutterFlowTheme.of(context).accent1, - ), Column( mainAxisSize: MainAxisSize.max, children: [ @@ -280,10 +225,6 @@ class _ScheduleProvisionalVisitPageWidgetState ), ].addToEnd(const SizedBox(height: 20.0)), ), - Divider( - thickness: 0.5, - color: FlutterFlowTheme.of(context).accent1, - ), Column( mainAxisSize: MainAxisSize.max, children: [ @@ -324,6 +265,7 @@ class _ScheduleProvisionalVisitPageWidgetState autofocus: false, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( '8zgsw5so' /* Ínicio da Visita */, @@ -403,7 +345,7 @@ class _ScheduleProvisionalVisitPageWidgetState BorderRadius.circular(8.0), ), suffixIcon: Icon( - Icons.hourglass_top, + Icons.date_range, color: FlutterFlowTheme.of(context) .accent1, ), @@ -528,10 +470,6 @@ class _ScheduleProvisionalVisitPageWidgetState ), ], ), - Divider( - thickness: 0.5, - color: FlutterFlowTheme.of(context).accent1, - ), Column( mainAxisSize: MainAxisSize.max, children: [ @@ -577,6 +515,7 @@ class _ScheduleProvisionalVisitPageWidgetState textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( 'wehvxbz4' /* Nome do Visitante */, @@ -685,10 +624,6 @@ class _ScheduleProvisionalVisitPageWidgetState ), ], ), - Divider( - thickness: 0.5, - color: FlutterFlowTheme.of(context).accent1, - ), Column( mainAxisSize: MainAxisSize.max, children: [ @@ -730,6 +665,7 @@ class _ScheduleProvisionalVisitPageWidgetState textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( 'cw8b3tbb' /* Observações da Visita */, @@ -803,7 +739,7 @@ class _ScheduleProvisionalVisitPageWidgetState BorderRadius.circular(10.0), ), suffixIcon: Icon( - Icons.format_color_text, + Icons.text_fields, color: FlutterFlowTheme.of(context) .accent1, ), @@ -832,11 +768,6 @@ class _ScheduleProvisionalVisitPageWidgetState ), ], ), - Container( - width: 100.0, - height: 54.0, - decoration: const BoxDecoration(), - ), ], ), ), @@ -923,7 +854,7 @@ class _ScheduleProvisionalVisitPageWidgetState ], ), ] - .addToStart(const SizedBox(height: 40.0)) + .addToStart(const SizedBox(height: 4.0)) .addToEnd(const SizedBox(height: 40.0)), ), ),