From b2cb9a4c35f96d6fd24225408ca235efbfcad1d6 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 30 Aug 2024 08:31:27 -0300 Subject: [PATCH] WIP --- lib/actions/actions.dart | 88 ++++++----------- .../notifications/notification_service.dart | 49 +++++----- .../message_opt_modal/opt_modal_widget.dart | 4 +- .../opt_modal/opt_modal_widget.dart | 7 +- .../option_selection_modal_widget.dart | 26 ++--- .../order_filter_modal_widget.dart | 4 +- .../throw_exception_widget.dart | 10 +- .../visitor_not_found_component_widget.dart | 13 ++- ..._arrow_linked_locals_component_widget.dart | 5 +- .../menu_component/menu_component_model.dart | 94 ++++++++++--------- .../menu_component/menu_component_widget.dart | 14 --- .../schedule_visit_detail_widget.dart | 15 +-- ..._arrow_linked_locals_component_widget.dart | 3 +- ...cation_modal_template_component_model.dart | 6 +- .../change_pass_widget.dart | 12 ++- .../details_component_action.dart | 28 +++--- ...ot_password_template_component_widget.dart | 2 +- ...item_details_template_component_model.dart | 8 +- .../message_notification_model.dart | 4 +- ...de_pass_key_template_component_widget.dart | 36 +++---- .../view_visit_detail_widget.dart | 33 +++---- ...tails_modal_template_component_widget.dart | 3 +- ...earch_modal_template_component_widget.dart | 14 +-- lib/flutter_flow/flutter_flow_util.dart | 3 +- lib/flutter_flow/nav/nav.dart | 41 +++++--- lib/flutter_flow/upload_data.dart | 9 +- .../delivery_schedule_widget.dart | 3 +- .../fast_pass_page/fast_pass_page_widget.dart | 5 +- .../liberation_history_widget.dart | 4 +- .../preferences_settings_model.dart | 43 +++++---- .../provisional_schedule_widget.dart | 3 +- .../reception_page/reception_page_widget.dart | 4 +- .../reservation_page_widget.dart | 12 +-- .../schedule_complete_visit_page_widget.dart | 4 +- 34 files changed, 299 insertions(+), 310 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 58e25485..fef3a6f9 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -9,7 +9,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/random_data_util.dart'; -import 'package:hub/index.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:qr_flutter/qr_flutter.dart'; import 'package:share_plus/share_plus.dart'; @@ -35,48 +34,17 @@ Future repeatVisitScheduleAction( bool? visitTempBol, String? visitObsStr, }) async { - context.pushNamed( - 'scheduleCompleteVisitPage', - queryParameters: { - 'visitStartDateStr': serializeParam( - visitStartDateStr, - ParamType.String, - ), - 'visitEndDateStr': serializeParam( - visitEndDateStr, - ParamType.String, - ), - 'visitReasonStr': serializeParam( - visitReasonStr, - ParamType.String, - ), - 'visitLevelStr': serializeParam( - visitLevelStr, - ParamType.String, - ), - 'visitTempBol': serializeParam( - visitTempBol, - ParamType.bool, - ), - 'visitObsStr': serializeParam( - visitObsStr, - ParamType.String, - ), - 'visitorStrList': serializeParam( - visitorStrList, - ParamType.String, - ), - 'visitorJsonList': serializeParam( - visitorJsonList, - ParamType.JSON, - isList: true, - ), - }.withoutNulls, + context.go( + '/scheduleCompleteVisitPage', extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), + 'visitStartDateStr': visitStartDateStr, + 'visitEndDateStr': visitEndDateStr, + 'visitReasonStr': visitReasonStr, + 'visitLevelStr': visitLevelStr, + 'visitTempBol': visitTempBol, + 'visitObsStr': visitObsStr, + 'visitorStrList': visitorStrList, + 'visitorJsonList': visitorJsonList, }, ); } @@ -153,7 +121,8 @@ Future singInLoginAction( AppState().serialNumber = await getSerialNumber() ?? ''; AppState().isLogged = true; - AppState().haveLocal = await checkLocals(context: context, model: model); + AppState().haveLocal = + await checkLocals(context: context, model: model); toggleApp(context, AppState().haveLocal!); } else { if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) { @@ -261,8 +230,8 @@ Future forgotPasswdAction( } Future toggleSignInPage(BuildContext context) async { - context.pushNamed( - 'signInPage', + context.go( + '/signInPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -273,8 +242,8 @@ Future toggleSignInPage(BuildContext context) async { } Future toggleSignUpPage(BuildContext context) async { - context.pushNamed( - 'signUpPage', + context.go( + '/signUpPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -286,10 +255,10 @@ Future toggleSignUpPage(BuildContext context) async { Future toggleApp(BuildContext context, bool haveLocal) async { if (haveLocal == true) { - Navigator.push(context, MaterialPageRoute(builder: (context) => const HomePageWidget())); + context.go('/homePage'); } else if (haveLocal == false) { - context.pushNamed( - 'receptionPage', + context.go( + '/receptionPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -421,7 +390,8 @@ Future changeStatusAction( String accessKey, String email, ) async { - Navigator.pop(context, true); + // Navigator.pop(context, true); + context.pop(true); bool? blockVisitRequest; blockVisitRequest = await visitCancelAction( @@ -628,8 +598,8 @@ Future scheduleVisitOptAction(BuildContext context) async { } Future registerVisitorOptAction(BuildContext context) async { - context.pushNamed( - 'registerVisitorPage', + context.go( + '/registerVisitorPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -641,8 +611,8 @@ Future registerVisitorOptAction(BuildContext context) async { } Future peopleOnThePropertyAction(BuildContext context) async { - context.pushNamed( - 'peopleOnThePropertyPage', + context.go( + '/peopleOnThePropertyPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -653,8 +623,8 @@ Future peopleOnThePropertyAction(BuildContext context) async { } Future preferencesSettings(BuildContext context) async { - context.pushNamed( - 'preferencesSettings', + context.go( + '/preferencesSettings', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -712,8 +682,8 @@ Future liberationHistoryOptAction(BuildContext context) async { } Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', + context.go( + '/qrCodePage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, diff --git a/lib/backend/notifications/notification_service.dart b/lib/backend/notifications/notification_service.dart index 866ec7d3..8a535379 100644 --- a/lib/backend/notifications/notification_service.dart +++ b/lib/backend/notifications/notification_service.dart @@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/utils/dialog_util.dart'; class NotificationService { @@ -18,17 +19,17 @@ class NotificationService { 'resource://drawable/notification_icon', [ NotificationChannel( - channelKey: 'basic_channel', - channelGroupKey: 'basic_channel', - channelName: 'Notificações do App', - channelDescription: 'Canal de notificação do Aplicativo', - importance: NotificationImportance.Max, - channelShowBadge: false, - playSound: true, - criticalAlerts: true, - onlyAlertOnce: true, - defaultColor: Colors.green, - ledColor: Colors.white, + channelKey: 'basic_channel', + channelGroupKey: 'basic_channel', + channelName: 'Notificações do App', + channelDescription: 'Canal de notificação do Aplicativo', + importance: NotificationImportance.Max, + channelShowBadge: false, + playSound: true, + criticalAlerts: true, + onlyAlertOnce: true, + defaultColor: Colors.green, + ledColor: Colors.white, ) ], channelGroups: [ @@ -106,7 +107,7 @@ class NotificationService { ptText: 'Não', ), onPressed: () { - Navigator.pop(context); + context.pop(); }, options: FFButtonOptions( width: 100, @@ -143,16 +144,16 @@ class NotificationService { ) .then((value) { if (value) { - Navigator.pop(context); - Navigator.pop(context); + context.pop(); + context.pop(); } else { - Navigator.pop(context); - Navigator.pop(context); + context.pop(); + context.pop(); DialogUtil.errorDefault(context); } }).catchError((e) { - Navigator.pop(context); - Navigator.pop(context); + context.pop(); + context.pop(); DialogUtil.errorDefault(context); }); }, @@ -203,16 +204,16 @@ class NotificationService { ) .then((value) { if (value) { - Navigator.pop(context); - Navigator.pop(context); + context.pop(); + context.pop(); } else { - Navigator.pop(context); - Navigator.pop(context); + context.pop(); + context.pop(); DialogUtil.errorDefault(context); } }).catchError((e) { - Navigator.pop(context); - Navigator.pop(context); + context.pop(); + context.pop(); DialogUtil.errorDefault(context); }); }); diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart index 53a01170..19ecdff5 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart @@ -3,6 +3,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -78,7 +79,8 @@ class _OptModalWidgetState extends State { filterResult['accessType'] = selected['accessType']!.first; } - Navigator.pop(context, filterResult); + // Navigator.pop(context, filterResult); + context.pop(filterResult); } Widget _buildCheckboxListTile( 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 b2394f52..21be811f 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart @@ -1,10 +1,10 @@ - import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -84,7 +84,8 @@ class _OptModalWidgetState extends State { filterResult['accessType'] = selected['accessType']!.first; } - Navigator.pop(context, filterResult); + // Navigator.pop(context, filterResult); + context.pop(filterResult); } Widget _buildCheckboxListTile(String key, List> options) { @@ -329,4 +330,4 @@ class _OptModalWidgetState extends State { ), ); } -} \ No newline at end of file +} 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 83093a34..a445cc81 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 @@ -8,8 +8,6 @@ import 'package:hub/flutter_flow/flutter_flow_animations.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; - - class OptionSelectionModalWidget extends StatefulWidget { const OptionSelectionModalWidget({ super.key, @@ -73,7 +71,7 @@ class _OptionSelectionModalWidgetState extends State padding: const EdgeInsets.all(8.0), child: GestureDetector( onTap: () async { - Navigator.pop(context); + context.pop(); }, child: Align( alignment: Alignment.center, @@ -93,19 +91,23 @@ class _OptionSelectionModalWidgetState extends State itemBuilder: (context, optionsListIndex) { return GestureDetector( onTap: () async { - Navigator.pop(context); - if (widget.routesListStr![optionsListIndex] == 'scheduleCompleteVisitPage') { + context.pop(); + if (widget.routesListStr![optionsListIndex] == + 'scheduleCompleteVisitPage') { // Navegação para a página ScheduleCompleteVisitPage com queryParameters - context.pushNamed( - 'scheduleCompleteVisitPage', - queryParameters: { - 'visitStartDateStr': DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()), - 'visitEndDateStr': DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))), + context.go( + '/scheduleCompleteVisitPage', + extra: { + 'visitStartDateStr': DateFormat('yyyy-MM-dd HH:mm:ss') + .format(DateTime.now()), + 'visitEndDateStr': DateFormat('yyyy-MM-dd HH:mm:ss') + .format( + DateTime.now().add(const Duration(days: 1))), }, ); } else { // Navegação para outras páginas - context.pushNamed(widget.routesListStr![optionsListIndex]); + context.go(widget.routesListStr![optionsListIndex]); } }, child: Padding( @@ -217,4 +219,4 @@ class _OptionSelectionModalWidgetState extends State ), ); } -} \ No newline at end of file +} diff --git a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart index 60adbaa4..ddd13a38 100644 --- a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart +++ b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart @@ -3,6 +3,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/molecular_components/order_filter_modal/order_filter_modal_model.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; class OrderFilterModalWidget extends StatefulWidget { final String defaultAdresseeType; @@ -91,7 +92,8 @@ class _OrderFilterModalWidgetState extends State { filterResult['status'] = selected['status']!.first; } - Navigator.pop(context, filterResult); + // Navigator.pop(context, filterResult); + context.pop(filterResult); } Widget _buildCheckboxListTile( diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart index 27187afb..324be78c 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -1,12 +1,14 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/enums/enum_throw_exception.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'throw_exception_model.dart'; + export 'throw_exception_model.dart'; class ThrowExceptionWidget extends StatefulWidget { @@ -110,7 +112,7 @@ class _ThrowExceptionWidgetState extends State hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); + context.pop(); }, child: Column( mainAxisSize: MainAxisSize.max, diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 7bf37a7d..5b5ce3be 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -1,14 +1,12 @@ -import 'dart:developer'; - +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart'; import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; - -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; class VisitorNotFoundComponentWidget extends StatefulWidget { const VisitorNotFoundComponentWidget({this.doc, Key? key}) : super(key: key); @@ -75,7 +73,7 @@ class _VisitorNotFoundComponentWidgetState size: 24.0, ), onPressed: () async { - Navigator.pop(context); + context.pop(); }, ), ), @@ -146,7 +144,8 @@ class _VisitorNotFoundComponentWidgetState ), ); }, - ).then((value) => Navigator.pop(context, value)); + ).then((value) => context.pop(value)); + // Navigator.pop(context, value) }, text: FFLocalizations.of(context) .getVariableText(enText: 'Add', ptText: 'Adicionar'), 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 5d899cab..29186c59 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 @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:provider/provider.dart'; @@ -167,7 +168,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState AppState().cliUUID = local['CLI_ID']; AppState().local = local['CLI_NOME']; AppState().ownerUUID = local['CLU_OWNER_ID']; - Navigator.pop(context); + context.pop(); } else if (local['CLU_STATUS'] == 'B') { String message = FFLocalizations.of(context).getVariableText( ptText: @@ -193,7 +194,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState enText: 'Do you wish to accept the link to $localName?'), () async { var response = await _fetchResponseLink('A', local['CLI_ID']); - Navigator.pop(context); + context.pop(); if (response['error'] == true) { DialogUtil.error(context, response['error_msg']); 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 da721e49..4d6abf72 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; -import 'package:hub/pages/reservation_page/reservation_page_widget.dart'; import 'package:hub/shared/extensions/dialog_extensions.dart'; import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; @@ -41,9 +40,22 @@ class MenuComponentModel extends FlutterFlowModel { isGrid = !isGrid; } + Future accessQRCodeOptAction(BuildContext context) async { + context.push( + '/qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + Future scheduleCompleteVisitAction(BuildContext context) async { - context.pushNamed( - 'scheduleCompleteVisitPage', + context.push( + '/scheduleCompleteVisitPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -57,8 +69,8 @@ class MenuComponentModel extends FlutterFlowModel { Future deliverySchedule(BuildContext context) async { final isProvisional = AppState().provisional; if (isProvisional == true) { - context.pushNamed( - 'deliverySchedule', + context.push( + '/deliverySchedule', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -75,8 +87,8 @@ class MenuComponentModel extends FlutterFlowModel { Future provisionalSchedule(BuildContext context) async { final isProvisional = AppState().provisional; if (isProvisional == true) { - context.pushNamed( - 'provisionalSchedule', + context.push( + '/provisionalSchedule', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -93,8 +105,8 @@ class MenuComponentModel extends FlutterFlowModel { Future fastPassAction(BuildContext context) async { final isWpp = AppState().whatsapp; if (isWpp) { - context.pushNamed( - 'fastPassPage', + context.push( + '/fastPassPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -150,8 +162,8 @@ class MenuComponentModel extends FlutterFlowModel { } Future registerVisitorOptAction(BuildContext context) async { - context.pushNamed( - 'registerVisitorPage', + context.push( + '/registerVisitorPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -163,8 +175,8 @@ class MenuComponentModel extends FlutterFlowModel { } Future peopleOnThePropertyAction(BuildContext context) async { - context.pushNamed( - 'peopleOnThePropertyPage', + context.push( + '/peopleOnThePropertyPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -184,8 +196,8 @@ class MenuComponentModel extends FlutterFlowModel { ), () async { AppState().deleteAll(); - context.pushNamed( - 'welcomePage', + context.go( + '/welcomePage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -198,8 +210,8 @@ class MenuComponentModel extends FlutterFlowModel { } Future preferencesSettings(BuildContext context) async { - context.pushNamed( - 'preferencesSettings', + context.push( + '/preferencesSettings', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -207,15 +219,15 @@ class MenuComponentModel extends FlutterFlowModel { alignment: Alignment.bottomCenter, ), }, - ).then((value) => true); + ); } Future packageOrder(BuildContext context) async { final isWpp = AppState().whatsapp; if (isWpp) { - context.pushNamed( - 'packageOrder', + context.push( + '/packageOrder', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -223,7 +235,7 @@ class MenuComponentModel extends FlutterFlowModel { alignment: Alignment.bottomCenter, ), }, - ).then((value) => true); + ); } else { DialogUnavailable.unavailableFeature(context); } @@ -232,7 +244,16 @@ class MenuComponentModel extends FlutterFlowModel { Future reservation(BuildContext context) async { final isWpp = AppState().whatsapp; if (isWpp) { - Navigator.push(context, MaterialPageRoute(builder: (context) => ReservationPageWidget())); + context.push( + '/reservation', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); } else { DialogUnavailable.unavailableFeature(context); } @@ -285,8 +306,8 @@ class MenuComponentModel extends FlutterFlowModel { } Future liberationHistoryAction(BuildContext context) async { - context.pushNamed( - 'liberationHistory', + context.push( + '/liberationHistory', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -298,8 +319,8 @@ class MenuComponentModel extends FlutterFlowModel { } Future accessHistoryAction(BuildContext context) async { - context.pushNamed( - 'acessHistoryPage', + context.push( + '/acessHistoryPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -311,21 +332,8 @@ class MenuComponentModel extends FlutterFlowModel { } Future visitHistoryAction(BuildContext context) async { - context.pushNamed( - 'scheduleCompleteVisitPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', + context.push( + '/scheduleCompleteVisitPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -337,8 +345,8 @@ class MenuComponentModel extends FlutterFlowModel { } Future messageHistoryAction(BuildContext context) async { - context.pushNamed( - 'messageHistoryPage', + context.push( + '/messageHistoryPage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart index 33dce883..35a6e9d7 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -3,7 +3,6 @@ import 'package:hub/backend/schema/enums/enums.dart'; import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.dart'; import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; -import 'package:hub/flutter_flow/nav/nav.dart'; import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; @@ -584,17 +583,4 @@ class _MenuComponentWidgetState extends State { }, ); } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } } diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index 7eba3a25..e8338984 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -1,19 +1,14 @@ -import 'package:hub/app_state.dart'; -import 'package:hub/backend/api_requests/api_calls.dart'; - -import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; - import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; -import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import 'package:hub/flutter_flow/custom_functions.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; -import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; class ScheduleVisitDetailWidget extends StatefulWidget { @@ -156,7 +151,7 @@ class _ScheduleVisitDetailWidgetState extends State { size: 24.0, ), onPressed: () async { - Navigator.pop(context); + context.pop(); }, ), ), @@ -808,7 +803,7 @@ class _ScheduleVisitDetailWidgetState extends State { (_model.postScheduleVisit?.jsonBody ?? ''), ) == false) { - Navigator.pop(context); + context.pop(); } else { await showModalBottomSheet( isScrollControlled: true, diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart index 898e309c..65641bb8 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart @@ -6,6 +6,7 @@ import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; class UpArrowLinkedLocalsComponentWidget extends StatefulWidget { @@ -140,7 +141,7 @@ class _UpArrowLinkedLocalsComponentWidgetState r'''$.CLI_NOME''', ).toString(); setState(() {}); - Navigator.pop(context); + context.pop(); }, child: Container( width: 50.0, 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 aa137fa5..f875a50b 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 @@ -1,8 +1,10 @@ +import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + 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 { @@ -68,7 +70,7 @@ class AccessNotificationModalTemplateComponentModel (visitRequest.jsonBody ?? ''), ) == false) { - Navigator.pop(context); + context.pop(); return true; } else { return false; diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart index 7a4d0fbb..36f51006 100644 --- a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart @@ -1,13 +1,14 @@ +import 'package:easy_debounce/easy_debounce.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import 'package:easy_debounce/easy_debounce.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'change_pass_model.dart'; + export 'change_pass_model.dart'; class PassKeyTemplateWidget extends StatefulWidget { @@ -311,7 +312,8 @@ class _PassKeyTemplateWidgetState extends State { ? _model.keyTextFieldTextController2.text : _model.keyTextFieldTextController1.text, ); - Navigator.pop(context, true); + // Navigator.pop(context, true); + context.pop(true); }, text: FFLocalizations.of(context).getVariableText( ptText: diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index ace71315..447fc265 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -4,7 +4,7 @@ import 'package:hub/components/templates_components/details_component/details_co import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; -import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/utils/validator_util.dart'; import 'package:share_plus/share_plus.dart'; @@ -43,7 +43,9 @@ Widget buildDetails( visitaWrapItem['VTE_DOCUMENTO'] ?? '', ) .then((value) { - Navigator.pop(context, value); + // Navigator.pop(context, value); + context.pop(value); + if (value == false) { showSnackbar( context, @@ -64,7 +66,7 @@ Widget buildDetails( ); } }).catchError((err, stack) { - Navigator.pop(context); + context.pop(); showSnackbar( context, FFLocalizations.of(context).getVariableText( @@ -100,19 +102,15 @@ Widget buildDetails( ), icon: const Icon(Icons.refresh), onPressed: () async { - Navigator.pop(context); - Navigator.pop(context); + context.pop(); + context.pop(); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ScheduleCompleteVisitPageWidget( - dropdownValue1: visitaWrapItem['MOT_DESCRICAO'], - dropdownValue2: visitaWrapItem['NAC_DESCRICAO'], - visitorJsonList: [visitaWrapItem], - visitorStrList: visitaWrapItem['VTE_DOCUMENTO'], - )), - ); + context.pushNamed('scheduleCompleteVisitPage', extra: { + 'dropdownValue1': visitaWrapItem['MOT_DESCRICAO'], + 'dropdownValue2': visitaWrapItem['NAC_DESCRICAO'], + 'visitorJsonList': [visitaWrapItem], + 'visitorStrList': visitaWrapItem['VTE_DOCUMENTO'], + }); }, options: FFButtonOptions( width: 130, diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart index ab79bc56..58a03d09 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -273,7 +273,7 @@ class _ForgotPasswordTemplateComponentWidgetState FFLocalizations.of(context).getVariableText( enText: "Send E-mail Successful!", ptText: "E-mail Enviado com Sucesso!")); - Navigator.pop(context); + context.pop(); } else { await DialogUtil.error( context, diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart index ff658878..0678c1f5 100644 --- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart @@ -1,11 +1,9 @@ +import 'package:flutter/material.dart'; import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart'; - import 'package:hub/flutter_flow/flutter_flow_model.dart'; - -import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; class LiberationHistoryItemDetailsTemplateComponentModel extends FlutterFlowModel< @@ -72,7 +70,7 @@ class LiberationHistoryItemDetailsTemplateComponentModel (visitRequest.jsonBody ?? ''), ) == false) { - Navigator.pop(context); + context.pop(); return true; } else { return false; diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart index 4f6358cb..31b96ea8 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; class MessageNotificationModalTemplateComponentModel extends FlutterFlowModel { @@ -69,7 +69,7 @@ class MessageNotificationModalTemplateComponentModel (visitRequest.jsonBody ?? ''), ) == false) { - Navigator.pop(context); + context.pop(); return true; } else { return false; diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart index 9fcaa067..dd902f7c 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart @@ -10,9 +10,6 @@ import 'package:google_fonts/google_fonts.dart'; import 'qr_code_pass_key_template_component_model.dart'; export 'qr_code_pass_key_template_component_model.dart'; - - - class QrCodePassKeyTemplateComponentWidget extends StatefulWidget { const QrCodePassKeyTemplateComponentWidget({ super.key, @@ -84,7 +81,8 @@ class _QrCodePassKeyTemplateComponentWidgetState tablet: false, )) Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -106,8 +104,8 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ), Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 12.0, 0.0, 0.0, 0.0), child: Text( '', style: @@ -127,7 +125,8 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( 'h1xilful' /* DIGITE A SUA SENHA */, @@ -143,7 +142,8 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), child: Text( FFLocalizations.of(context).getText( 'ujodm2ci' /* Para gerar o QR Code digite a ... */, @@ -163,7 +163,8 @@ class _QrCodePassKeyTemplateComponentWidgetState key: _model.formKey, autovalidateMode: AutovalidateMode.onUserInteraction, child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), child: SizedBox( width: double.infinity, child: TextFormField( @@ -275,8 +276,7 @@ class _QrCodePassKeyTemplateComponentWidgetState .asValidator(context), inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), - LengthLimitingTextInputFormatter(4), - + LengthLimitingTextInputFormatter(4), ], ), ), @@ -285,7 +285,8 @@ class _QrCodePassKeyTemplateComponentWidgetState Align( alignment: const AlignmentDirectional(0.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), child: FFButtonWidget( onPressed: () async { if (_model.formKey.currentState == null || @@ -295,7 +296,7 @@ class _QrCodePassKeyTemplateComponentWidgetState await widget.toggleActionStatus?.call( _model.keyTextFieldTextController.text, ); - Navigator.pop(context); + context.pop(); }, text: FFLocalizations.of(context).getText( '2cybbi5p' /* Enviar */, @@ -303,9 +304,10 @@ class _QrCodePassKeyTemplateComponentWidgetState options: FFButtonOptions( width: 270.0, height: 50.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), color: const Color(0xFF1AAB5F), textStyle: FlutterFlowTheme.of(context).titleSmall.override( fontFamily: 'Plus Jakarta Sans', @@ -331,4 +333,4 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index 047e9c9d..afb609a3 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -1,24 +1,17 @@ -import 'dart:convert'; -import 'dart:developer'; - +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; -import 'package:hub/flutter_flow/nav/serialization_util.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:provider/provider.dart'; +import 'package:share_plus/share_plus.dart'; import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_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 '/actions/actions.dart' as action_blocks; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:share_plus/share_plus.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; import 'view_visit_detail_model.dart'; + export 'view_visit_detail_model.dart'; class ViewVisitDetailWidget extends StatefulWidget { @@ -176,7 +169,7 @@ class _ViewVisitDetailWidgetState extends State { size: 24.0, ), onPressed: () async { - Navigator.pop(context); + context.pop(); }, ), ), @@ -211,7 +204,7 @@ class _ViewVisitDetailWidgetState extends State { hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - // Navigator.pop(context); + // context.pop(); // await showModalBottomSheet( // isScrollControlled: true, // backgroundColor: Colors.transparent, @@ -840,7 +833,7 @@ class _ViewVisitDetailWidgetState extends State { (_model.deleteVisit?.jsonBody ?? ''), ) == false) { - Navigator.pop(context); + context.pop(); } else { final error = await DialogUtil.errorDefault(context); @@ -890,11 +883,11 @@ class _ViewVisitDetailWidgetState extends State { hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); + context.pop(); - context.pushNamed( - 'scheduleCompleteVisitPage', - queryParameters: { + context.go( + '/scheduleCompleteVisitPage', + extra: { 'visitStartDateStr': serializeParam( dateTimeFormat( 'd/M/y H:mm:ss', diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart index 4d37a149..98309e51 100644 --- a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart @@ -1,6 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -92,7 +93,7 @@ class _VisitorDetailsModalTemplateComponentWidgetState hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); + context.pop(); }, child: Icon( Icons.close, diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index e00b2a7e..d272a8d7 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,21 +1,17 @@ -import 'dart:developer'; - +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:fluttertoast/fluttertoast.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/atomic_components/shared_components_atoms/toast.dart'; import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; -import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; -import 'package:hub/flutter_flow/internationalization.dart'; - -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { @@ -434,7 +430,7 @@ class _VisitorSearchModalTemplateComponentWidgetState await widget.getDocs?.call( _model.docs, ); - Navigator.pop(context); + context.pop(); } Future addVisitor(BuildContext context) async { diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 4aa04b61..46f249a2 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -9,6 +9,7 @@ import 'package:from_css_color/from_css_color.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:intl/intl.dart'; import 'package:json_path/json_path.dart'; import 'package:timeago/timeago.dart' as timeago; @@ -567,7 +568,7 @@ void showAlertDialog(BuildContext context, String title, String content, mainAxisSize: MainAxisSize.max, children: [ FFButtonWidget( - onPressed: () => Navigator.pop(context), + onPressed: () => context.pop(), //Navigator.pop(context), options: FFButtonOptions( width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.height * 0.05, diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index cf0963cc..967e1c4c 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -96,20 +96,33 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( builder: (context, params) => const RegisterVisitorPageWidget(), ), FFRoute( - name: 'scheduleCompleteVisitPage', - path: '/scheduleCompleteVisitPage', - builder: (context, params) => ScheduleCompleteVisitPageWidget( - visitorStrList: params.getParam( - 'visitorStrList', - ParamType.String, - ), - visitorJsonList: params.getParam( - 'visitorJsonList', - ParamType.JSON, - isList: true, - ), - ), - ), + name: 'scheduleCompleteVisitPage', + path: '/scheduleCompleteVisitPage', + builder: (context, params) { + final dropdownValue1 = params.getParam( + 'dropdownValue1', + ParamType.String, + ); + final dropdownValue2 = params.getParam( + 'dropdownValue2', + ParamType.String, + ); + final visitorStrList = params.getParam( + 'visitorStrList', + ParamType.String, + ); + final visitorJsonList = params.getParam( + 'visitorJsonList', + ParamType.JSON, + isList: true, + ); + return ScheduleCompleteVisitPageWidget( + dropdownValue1: dropdownValue1 ?? '', + dropdownValue2: dropdownValue2 ?? '', + visitorStrList: visitorStrList ?? '', + visitorJsonList: visitorJsonList ?? [], + ); + }), FFRoute( name: 'deliverySchedule', path: '/deliverySchedule', diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index 0de40df7..ed5e1e7b 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -1,9 +1,10 @@ import 'dart:async'; import 'package:file_picker/file_picker.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:image_picker/image_picker.dart'; import 'package:mime_type/mime_type.dart'; import 'package:video_player/video_player.dart'; @@ -79,10 +80,8 @@ Future?> selectMediaWithSourceBottomSheet({ ), tileColor: FlutterFlowTheme.of(context).primaryBackground, dense: false, - onTap: () => Navigator.pop( - context, - mediaSource, - ), + onTap: () => context.pop(mediaSource), + // Navigator.pop(context,mediaSource,), ); final mediaSource = await showModalBottomSheet( context: context, diff --git a/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart b/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart index 2d75026e..1951c608 100644 --- a/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart +++ b/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart @@ -4,6 +4,7 @@ import 'package:hub/components/templates_components/provisional_schedule_templat import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -53,7 +54,7 @@ class _DeliveryScheduleState extends State { size: 30.0, ), onPressed: () async { - Navigator.pop(context); + context.pop(); }, ), title: Text( diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart b/lib/pages/fast_pass_page/fast_pass_page_widget.dart index a61d730c..6ad8a974 100644 --- a/lib/pages/fast_pass_page/fast_pass_page_widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/utils/webview_util.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; @@ -69,7 +70,7 @@ class _FastPassPageWidgetState extends State { }, onUpdateVisitedHistory: (controller, uri, isVisited) { if (uri.toString().contains('/hub/home')) { - Navigator.pop(context); + context.pop(); } }, ) @@ -116,7 +117,7 @@ class _FastPassPageWidgetState extends State { }, onUrlChange: (url) { if (url.url.toString().contains('/hub/home')) { - Navigator.pop(context); + context.pop(); } }), ) diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index c0ba0cda..9e278249 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -262,7 +262,7 @@ class _LiberationHistoryWidgetState extends State { _requestFuture = _fetchRequests(); }); - Navigator.pop(context); + context.pop(); }); }, ), @@ -309,7 +309,7 @@ class _LiberationHistoryWidgetState extends State { _requestFuture = _fetchRequests(); }); - Navigator.pop(context); + context.pop(); }); }, ) diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index d118c578..0be0102d 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -128,7 +128,7 @@ class PreferencesPageModel with ChangeNotifier { ptText: 'Não', ), onPressed: () { - Navigator.pop(context); + context.pop(); }, options: FFButtonOptions( elevation: 0, @@ -157,7 +157,7 @@ class PreferencesPageModel with ChangeNotifier { ) .then((value) { if (value.jsonBody['error'] == false) { - Navigator.pop(context); + context.pop(); AppState().notify = !AppState().notify; ScaffoldMessenger.of(context).showSnackBar( @@ -203,7 +203,7 @@ class PreferencesPageModel with ChangeNotifier { ); } }).catchError((err) { - Navigator.pop(context); + context.pop(); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -226,7 +226,7 @@ class PreferencesPageModel with ChangeNotifier { }).whenComplete(() => notifyListeners()); } on Exception catch (e) { log(e.toString()); - Navigator.pop(context); + context.pop(); } }, text: FFLocalizations.of(context).getVariableText( @@ -285,7 +285,7 @@ class PreferencesPageModel with ChangeNotifier { ptText: 'Cancelar', ), onPressed: () { - Navigator.pop(context); + context.pop(); }, options: FFButtonOptions( width: MediaQuery.of(context).size.width * 0.3, @@ -316,8 +316,19 @@ class PreferencesPageModel with ChangeNotifier { AppState().deleteLocal(); AppState().deleteOwnerUUID(); - context.pushNamed( - 'homePage', + context.pop(); + context.go( + '/homePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + context.replace( + '/homePage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -351,7 +362,7 @@ class PreferencesPageModel with ChangeNotifier { }) // ignore: body_might_complete_normally_catch_error .catchError((err, stack) { - Navigator.pop(context); + context.pop(); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -374,7 +385,7 @@ class PreferencesPageModel with ChangeNotifier { }); // notifyListeners(); } catch (err, stack) { - Navigator.pop(context); + context.pop(); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -444,7 +455,7 @@ class PreferencesPageModel with ChangeNotifier { mainAxisSize: MainAxisSize.max, children: [ FFButtonWidget( - onPressed: () => Navigator.pop(context), + onPressed: () => context.pop(), // Navigator.pop(context), options: FFButtonOptions( width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.height * 0.05, @@ -475,8 +486,8 @@ class PreferencesPageModel with ChangeNotifier { if (value.jsonBody['error'] == false) { AppState().deleteAll(); AppState().isLogged = false; - context.goNamed( - 'welcomePage', + context.go( + '/welcomePage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, @@ -488,7 +499,7 @@ class PreferencesPageModel with ChangeNotifier { } }).catchError((err) { log(err.toString()); - Navigator.pop(context); + context.pop(); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -511,7 +522,7 @@ class PreferencesPageModel with ChangeNotifier { }); notifyListeners(); } catch (err, stack) { - Navigator.pop(context); + context.pop(); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( @@ -753,8 +764,8 @@ class PreferencesPageModel with ChangeNotifier { AppState().deleteAll(); // setState(() {}); - context.goNamed( - 'welcomePage', + context.go( + '/welcomePage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, diff --git a/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart b/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart index 0bb92f31..00c5c596 100644 --- a/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart +++ b/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart @@ -4,6 +4,7 @@ import 'package:hub/components/templates_components/provisional_schedule_templat import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -53,7 +54,7 @@ class _ProvisionalScheduleState extends State { size: 30.0, ), onPressed: () async { - Navigator.pop(context); + context.pop(); }, ), title: Text( diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index c76d1b8b..b4c40118 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -144,8 +144,8 @@ class _ReceptionPageWidgetState extends State { AppState().deleteAll(); setState(() {}); - context.goNamed( - 'welcomePage', + context.go( + '/welcomePage', extra: { kTransitionInfoKey: const TransitionInfo( hasTransition: true, diff --git a/lib/pages/reservation_page/reservation_page_widget.dart b/lib/pages/reservation_page/reservation_page_widget.dart index 772e5095..3a631a51 100644 --- a/lib/pages/reservation_page/reservation_page_widget.dart +++ b/lib/pages/reservation_page/reservation_page_widget.dart @@ -1,13 +1,13 @@ -import 'dart:developer'; +import 'dart:io' show Platform; -import 'package:flutter/scheduler.dart'; -import 'package:hub/app_state.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/utils/webview_util.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; -import 'dart:io' show Platform; class ReservationPageWidget extends StatefulWidget { final String freToken = AppState().userUUID; @@ -70,7 +70,7 @@ class _ReservationPageWidgetState extends State { }, onUpdateVisitedHistory: (controller, uri, isVisited) { if (uri.toString().contains('/hub/home')) { - Navigator.pop(context); + context.pop(); } }, ) @@ -117,7 +117,7 @@ class _ReservationPageWidgetState extends State { }, onUrlChange: (url) { if (url.url.toString().contains('/hub/home')) { - Navigator.pop(context); + context.pop(); } }), ) diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index c56f7d27..0f56c366 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -1634,7 +1634,7 @@ Widget scheduleVisit(BuildContext context, (value.jsonBody ?? ''), ) == false) { - Navigator.pop(context); + context.pop(); //MILESTONE _model.dropDownValue1 = null; @@ -1657,7 +1657,7 @@ Widget scheduleVisit(BuildContext context, await showShare(value.jsonBody); } else { await DialogUtil.errorDefault(context); - Navigator.pop(context); + context.pop(); } });