diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 877a3719..cef195ac 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 = ""; }; - 6436409727A31CD100820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409F27A31CDE00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409727A31CDF00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409A27A31CD600820AF7 /* 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 = ( - 6436409727A31CD100820AF7 /* pt */, - 6436409F27A31CDE00820AF7 /* en */, + 6436409727A31CDF00820AF7 /* pt */, + 6436409A27A31CD600820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 0e524454..ed8510c3 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -34,6 +34,7 @@ class PhpGroup { static RespondeSolicitacaoCall respondeSolicitacaoCall = RespondeSolicitacaoCall(); static GetAccessCall getAccessCall = GetAccessCall(); + static GetLiberationsCall getLiberationsCall = GetLiberationsCall(); } class LoginCall { @@ -1803,6 +1804,184 @@ class GetAccessCall { .toList(); } +class GetLiberationsCall { + Future call({ + String? devUUID = '', + String? userUUID = '', + String? cliID = '', + String? atividade = '', + }) async { + final baseUrl = PhpGroup.getBaseUrl(); + + return ApiManager.instance.makeApiCall( + callName: 'getLiberations', + apiUrl: '$baseUrl/processRequest.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + 'cliID': cliID, + 'atividade': atividade, + }, + 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''', + )); + List? rqList(dynamic response) => getJsonField( + response, + r'''$.solicitacoes''', + true, + ) as List?; + List? rqNotID(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_ID''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotDest(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_DESTINO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotSendDate(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_DTENVIO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotReceiveDate(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_DTRESPOSTA''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotEmailAnswer(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_EMAILRESPOSTA''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotReason(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_MOTIVO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotSendMsg(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_MSGENVIO''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotReceiveMsg(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_MSGRESPOSTA''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotName(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_NOME''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotOperator(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_OPERADOR''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotStatus(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_STATUS''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqNotVTE(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].NOT_VISITANTE''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqVteID(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].VTE_ID''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqVteName(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].VTE_NOME''', + true, + ) as List?) + ?.withoutNulls + .map((x) => castToType(x)) + .withoutNulls + .toList(); + List? rqVteRG(dynamic response) => (getJsonField( + response, + r'''$.solicitacoes[:].VTE_RG''', + 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_widget.dart b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart index 88e99ff6..470361cb 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart @@ -220,7 +220,7 @@ class _OptModalWidgetState extends State { ), Text( FFLocalizations.of(context).getText( - '20wie2n3' /* Morador */, + 'oonqk812' /* Morador */, ), style: FlutterFlowTheme.of(context) .bodyMedium @@ -277,7 +277,7 @@ class _OptModalWidgetState extends State { ), Text( FFLocalizations.of(context).getText( - 'pglvsv6g' /* Visitante */, + 'zok7lu4w' /* Visitante */, ), style: FlutterFlowTheme.of(context) .bodyMedium 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 index 9318a07c..b0f33c80 100644 --- 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 @@ -24,10 +24,6 @@ class AccessNotificationModalTemplateComponentModel 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) {} @@ -45,9 +41,6 @@ class AccessNotificationModalTemplateComponentModel textFieldFocusNode4?.dispose(); textController4?.dispose(); - - textFieldFocusNode5?.dispose(); - textController5?.dispose(); } /// Action blocks. 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 index ee10a48e..49da60fe 100644 --- 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 @@ -50,14 +50,11 @@ class _AccessNotificationModalTemplateComponentWidgetState _model.textController2 ??= TextEditingController(text: widget.type); _model.textFieldFocusNode2 ??= FocusNode(); - _model.textController3 ??= TextEditingController(text: widget.id); + _model.textController3 ??= TextEditingController(text: widget.datetime); _model.textFieldFocusNode3 ??= FocusNode(); - _model.textController4 ??= TextEditingController(text: widget.datetime); + _model.textController4 ??= TextEditingController(text: widget.drive); _model.textFieldFocusNode4 ??= FocusNode(); - - _model.textController5 ??= TextEditingController(text: widget.drive); - _model.textFieldFocusNode5 ??= FocusNode(); } @override @@ -230,71 +227,13 @@ class _AccessNotificationModalTemplateComponentWidgetState FlutterFlowTheme.of(context) .bodyMediumFamily), ), - textAlign: TextAlign.center, + textAlign: TextAlign.start, 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)), @@ -302,8 +241,8 @@ class _AccessNotificationModalTemplateComponentWidgetState Padding( padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, autofocus: false, textInputAction: TextInputAction.next, readOnly: true, @@ -338,7 +277,7 @@ class _AccessNotificationModalTemplateComponentWidgetState errorBorder: InputBorder.none, focusedErrorBorder: InputBorder.none, suffixIcon: Icon( - Icons.history_edu, + Icons.date_range, color: FlutterFlowTheme.of(context).accent1, ), ), @@ -354,14 +293,14 @@ class _AccessNotificationModalTemplateComponentWidgetState maxLines: null, keyboardType: TextInputType.name, validator: - _model.textController4Validator.asValidator(context), + _model.textController3Validator.asValidator(context), ), ), Padding( padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( - controller: _model.textController5, - focusNode: _model.textFieldFocusNode5, + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, autofocus: false, textCapitalization: TextCapitalization.none, textInputAction: TextInputAction.next, @@ -410,7 +349,7 @@ class _AccessNotificationModalTemplateComponentWidgetState ), textAlign: TextAlign.start, validator: - _model.textController5Validator.asValidator(context), + _model.textController4Validator.asValidator(context), ), ), ] diff --git a/lib/flutter_flow/flutter_flow_theme.dart b/lib/flutter_flow/flutter_flow_theme.dart index 7429aca2..3ee2f331 100644 --- a/lib/flutter_flow/flutter_flow_theme.dart +++ b/lib/flutter_flow/flutter_flow_theme.dart @@ -68,6 +68,7 @@ abstract class FlutterFlowTheme { late Color customColor3; late Color customColor4; late Color customColor5; + late Color customColor6; @Deprecated('Use displaySmallFamily instead') String get title1Family => displaySmallFamily; @@ -177,6 +178,7 @@ class LightModeTheme extends FlutterFlowTheme { late Color customColor3 = const Color(0xFFFFFFFF); late Color customColor4 = const Color(0xFFCFCFCF); late Color customColor5 = const Color(0xFF979595); + late Color customColor6 = const Color(0xFF525252); } abstract class Typography { @@ -575,6 +577,7 @@ class DarkModeTheme extends FlutterFlowTheme { late Color customColor3 = const Color(0xFF1AAB5F); late Color customColor4 = const Color(0xFF232323); late Color customColor5 = const Color(0xFF232323); + late Color customColor6 = const Color(0xFF827F82); } extension TextStyleHelper on TextStyle { diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 2d387238..27e9971f 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -158,10 +158,6 @@ final kTranslationsMap = >>[ }, // registerVisitorPage { - 'q8cct5lk': { - 'pt': 'Cadastrar Visitante', - 'en': 'Register Visitor', - }, 'p4ftwxcy': { 'pt': 'Clique para adicionar a foto para o visitante', 'en': 'Click to add photo for visitor', @@ -214,6 +210,10 @@ final kTranslationsMap = >>[ 'pt': 'Cadastrar', 'en': 'Register', }, + 'megskb6s': { + 'pt': 'Cadastro Visitante', + 'en': 'Visitor Registration', + }, 'xtcz66ar': { 'pt': 'registerVisitor', 'en': '', @@ -418,20 +418,16 @@ final kTranslationsMap = >>[ // liberationHistory { 'dy0mx15f': { - 'pt': 'Label here...', - 'en': '', - }, - 'f77je6tr': { - 'pt': 'Visitante: ', - 'en': 'Visitor:', + 'pt': 'Pesquise aqui', + 'en': 'Search here', }, 'dkzewokx': { - 'pt': 'Início em: ', - 'en': 'Beginning in:', + 'pt': 'Date:', + 'en': 'Shipping:', }, - 'qi4mjhtw': { - 'pt': 'Fim em: ', - 'en': 'End in:', + '2s9avwbq': { + 'pt': 'Motivo:', + 'en': 'Reason:', }, '784f83pc': { 'pt': 'Histórico de Liberação', @@ -492,13 +488,13 @@ final kTranslationsMap = >>[ 'pt': 'Tipo de Pessoa', 'en': 'Type of Person', }, - '20wie2n3': { + 'oonqk812': { 'pt': 'Morador', - 'en': '', + 'en': 'Resident', }, - 'pglvsv6g': { + 'zok7lu4w': { 'pt': 'Visitante', - 'en': '', + 'en': 'Visitor', }, 'pepv7gl9': { 'pt': 'Tipo de Acesso', @@ -1020,14 +1016,6 @@ final kTranslationsMap = >>[ 'pt': 'Tipo', 'en': 'Type', }, - 'vjd9uwla': { - 'pt': 'Identificador', - 'en': 'Identifier', - }, - 's3nix1ot': { - 'pt': '', - 'en': '', - }, 'jveeqpdz': { 'pt': 'Acesso', 'en': 'Access', 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 59970ede..e6571428 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -71,7 +71,7 @@ class _AcessHistoryPageWidgetState extends State { style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, color: FlutterFlowTheme.of(context).primaryText, - fontSize: 18.0, + fontSize: 16.0, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).headlineMediumFamily), diff --git a/lib/pages/liberation_history/liberation_history_model.dart b/lib/pages/liberation_history/liberation_history_model.dart index 82830046..71f5efef 100644 --- a/lib/pages/liberation_history/liberation_history_model.dart +++ b/lib/pages/liberation_history/liberation_history_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 'liberation_history_widget.dart' show LiberationHistoryWidget; import 'package:flutter/material.dart'; @@ -11,6 +14,23 @@ class LiberationHistoryModel extends FlutterFlowModel { TextEditingController? textController; String? Function(BuildContext, String?)? textControllerValidator; + /// Query cache managers for this widget. + + final _getLiberationsManager = FutureRequestManager(); + Future getLiberations({ + String? uniqueQueryKey, + bool? overrideCache, + required Future Function() requestFn, + }) => + _getLiberationsManager.performRequest( + uniqueQueryKey: uniqueQueryKey, + overrideCache: overrideCache, + requestFn: requestFn, + ); + void clearGetLiberationsCache() => _getLiberationsManager.clear(); + void clearGetLiberationsCacheKey(String? uniqueKey) => + _getLiberationsManager.clearRequest(uniqueKey); + @override void initState(BuildContext context) {} @@ -19,5 +39,9 @@ class LiberationHistoryModel extends FlutterFlowModel { unfocusNode.dispose(); textFieldFocusNode?.dispose(); textController?.dispose(); + + /// Dispose query cache managers for this widget. + + clearGetLiberationsCache(); } } diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 7314f71f..a2391b02 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -1,5 +1,4 @@ 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'; @@ -83,7 +82,6 @@ class _LiberationHistoryWidgetState extends State { ), actions: const [], centerTitle: true, - elevation: 2.0, ), body: SafeArea( top: true, @@ -110,7 +108,7 @@ class _LiberationHistoryWidgetState extends State { decoration: InputDecoration( isDense: true, labelText: FFLocalizations.of(context).getText( - 'dy0mx15f' /* Label here... */, + 'dy0mx15f' /* Pesquise aqui */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -188,11 +186,13 @@ class _LiberationHistoryWidgetState 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.getLiberations( + requestFn: () => PhpGroup.getLiberationsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getSolicitacoes', + ), ), builder: (context, snapshot) { // Customize what your widget looks like when it's loading. @@ -208,12 +208,12 @@ class _LiberationHistoryWidgetState extends State { ), ); } - final wrapGetVisitsResponse = snapshot.data!; + final wrapGetLiberationsResponse = snapshot.data!; return Builder( builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, + final liberationHistory = PhpGroup.getLiberationsCall + .rqList( + wrapGetLiberationsResponse.jsonBody, ) ?.toList() ?? []; @@ -226,133 +226,79 @@ class _LiberationHistoryWidgetState extends State { runAlignment: WrapAlignment.start, verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, - children: List.generate(visitaWrap.length, - (visitaWrapIndex) { - final visitaWrapItem = - visitaWrap[visitaWrapIndex]; + children: List.generate(liberationHistory.length, + (liberationHistoryIndex) { + final liberationHistoryItem = + liberationHistory[liberationHistoryIndex]; 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( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + color: FlutterFlowTheme.of(context) + .secondaryBackground, + elevation: 5.0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 115.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 10.0, 0.0), + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + 'https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + liberationHistoryItem, + r'''$.VTE_ID''', ).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 {}, + width: 80.0, + fit: BoxFit.cover, ), ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Card( - clipBehavior: Clip.antiAliasWithSaveLayer, - color: FlutterFlowTheme.of(context) - .secondaryBackground, - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - 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, - children: [ - Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - 'f77je6tr' /* Visitante: */, - ), + ), + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional( + -1.0, -1.0), + child: Text( + getJsonField( + liberationHistoryItem, + r'''$.VTE_NOME''', + ).toString(), style: FlutterFlowTheme.of( context) @@ -375,17 +321,65 @@ class _LiberationHistoryWidgetState extends State { .bodyMediumFamily), ), ), - Align( - alignment: - const AlignmentDirectional( - -1.0, -1.0), - child: Text( - getJsonField( - visitaWrapItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme - .of(context) + ), + ] + .addToStart( + const SizedBox(width: 10.0)) + .addToEnd(const SizedBox( + width: 10.0)), + ), + Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Text( + FFLocalizations.of( + context) + .getText( + 'dkzewokx' /* Date: */, + ), + 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), + ), + ), + Text( + (functions.jsonToStr( + getJsonField( + liberationHistoryItem, + r'''$.NOT_STATUS''', + )) == + '\"L\"' + ? getJsonField( + liberationHistoryItem, + r'''$.NOT_DTRESPOSTA''', + ) + : getJsonField( + liberationHistoryItem, + r'''$.NOT_DTENVIO''', + )) + .toString(), + style: + FlutterFlowTheme.of( + context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of( @@ -400,310 +394,226 @@ class _LiberationHistoryWidgetState extends State { FlutterFlowTheme.of(context) .bodyMediumFamily), ), + ), + ] + .divide( + const SizedBox(width: 10.0)) + .addToStart(const SizedBox( + width: 10.0)), + ), + Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Text( + FFLocalizations.of( + context) + .getText( + '2s9avwbq' /* Motivo: */, + ), + 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), + ), + ), + Text( + getJsonField( + liberationHistoryItem, + r'''$.NOT_MOTIVO''', + ).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), + ), + ), + ] + .divide( + const SizedBox(width: 10.0)) + .addToStart(const SizedBox( + 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( + liberationHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"L\"') { + return FlutterFlowTheme + .of(context) + .success; + } else if (functions + .jsonToStr( + getJsonField( + liberationHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') { + return FlutterFlowTheme + .of(context) + .error; + } else if (functions + .jsonToStr( + getJsonField( + liberationHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"S\"') { + return FlutterFlowTheme + .of(context) + .warning; + } else { + return FlutterFlowTheme + .of(context) + .primary; + } + }(), + FlutterFlowTheme.of( + context) + .primary, ), + borderRadius: + BorderRadius + .circular(5.0), ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - 'dkzewokx' /* Início em: */, - ), - 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), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).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.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - 'qi4mjhtw' /* Fim em: */, - ), - 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), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).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)), - ), - 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( + child: Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + '${FFLocalizations.of(context).getVariableText( + ptText: 'Liberação', + enText: + 'Liberation', + )}${() { + if (functions.jsonToStr( + getJsonField( + liberationHistoryItem, + r'''$.NOT_STATUS''', + )) == + '\"L\"') { + return FFLocalizations + .of(context) + .getVariableText( + ptText: 'Ativa', + enText: + 'Active', + ); + } else if (functions + .jsonToStr( + getJsonField( + liberationHistoryItem, + r'''$.NOT_STATUS''', + )) == + '\"B\"') { + return FFLocalizations + .of(context) + .getVariableText( + ptText: + 'Bloqueada', + enText: + 'Blocked', + ); + } else if (functions + .jsonToStr( + getJsonField( + liberationHistoryItem, + r'''$.NOT_STATUS''', + )) == + '\"S\"') { + return FFLocalizations + .of(context) + .getVariableText( + ptText: + 'Pendente', + enText: + 'Warning', + ); + } else { + return FFLocalizations + .of(context) + .getVariableText( + ptText: + 'Desconhecida', + enText: + 'Unknow', + ); + } + }()}', + style: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of( context) - .success; - } else if (functions - .jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') { - return FlutterFlowTheme.of( + .bodyMediumFamily, + color: 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), - ), - ), + .info, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), ), ), ), - ].divide(const SizedBox(height: 3.0)), - ), + ), + ].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( - '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, - ), - ), - ], - ), + ), + ], ), ), ), diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index d2fba231..6cde8df2 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_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 '/flutter_flow/flutter_flow_drop_down.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'; @@ -62,6 +63,39 @@ class _RegisterVisitorPageWidgetState 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( + 'megskb6s' /* Cadastro Visitante */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), + ), + actions: const [], + centerTitle: true, + ), body: SafeArea( top: true, child: Align( @@ -83,28 +117,6 @@ class _RegisterVisitorPageWidgetState extends State { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, 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( - 'q8cct5lk' /* Cadastrar Visitante */, - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: 'Nunito', - fontSize: 21.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w800, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ), Builder( builder: (context) { if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? @@ -127,7 +139,7 @@ class _RegisterVisitorPageWidgetState extends State { _model.uploadedLocalFile.bytes ?? Uint8List.fromList([]), width: 300.0, - height: 100.0, + height: 200.0, fit: BoxFit.cover, ), ), @@ -325,7 +337,7 @@ class _RegisterVisitorPageWidgetState extends State { ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -409,7 +421,7 @@ class _RegisterVisitorPageWidgetState extends State { ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -525,7 +537,7 @@ class _RegisterVisitorPageWidgetState extends State { ), elevation: 2.0, borderColor: - FlutterFlowTheme.of(context).accent1, + FlutterFlowTheme.of(context).customColor6, borderWidth: 0.5, borderRadius: 8.0, margin: const EdgeInsetsDirectional.fromSTEB( @@ -603,7 +615,7 @@ class _RegisterVisitorPageWidgetState extends State { ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -685,7 +697,7 @@ class _RegisterVisitorPageWidgetState extends State { ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -734,7 +746,7 @@ class _RegisterVisitorPageWidgetState extends State { alignment: const AlignmentDirectional(0.0, 1.0), child: Padding( padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), + const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), child: FFButtonWidget( onPressed: () async { if (((_model.uploadedLocalFile.bytes @@ -864,7 +876,9 @@ class _RegisterVisitorPageWidgetState extends State { ), ), ), - ].divide(const SizedBox(height: 10.0)), + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 30.0)), ), ), ),