From 5445e5b8209cee4c860fbcb208de527e77f1845d Mon Sep 17 00:00:00 2001 From: "J. A. Messias" Date: Tue, 1 Oct 2024 09:30:27 -0300 Subject: [PATCH] WIP --- .../media_upload_button.dart | 19 +- .../menu_component/menu_component_model.dart | 482 +++++++++++------- .../menu_component/menu_component_widget.dart | 88 ++-- ...iter_vistor_template_component_widget.dart | 25 +- lib/flutter_flow/upload_data.dart | 7 + lib/shared/extensions/dialog_extensions.dart | 9 + 6 files changed, 388 insertions(+), 242 deletions(-) diff --git a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart index 1dadacc9..3dda5950 100644 --- a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart +++ b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart @@ -4,6 +4,7 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.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/upload_data.dart'; import 'package:hub/flutter_flow/uploaded_file.dart'; @@ -84,9 +85,13 @@ class _MediaUploadButtonUtilState extends State { var selectedUploadedFiles = []; try { + final message = FFLocalizations.of(context) + .getVariableText( + enText: 'Uploading file...', + ptText: 'Enviando arquivo...'); showUploadMessage( context, - 'Uploading file...', + message, showLoading: true, ); selectedUploadedFiles = selectedMedia @@ -108,11 +113,17 @@ class _MediaUploadButtonUtilState extends State { widget.uploadedFiles = selectedUploadedFiles.first; }); widget.onUploadComplete(widget.uploadedFiles!); - - showUploadMessage(context, 'Success!'); + final message = FFLocalizations.of(context) + .getVariableText( + enText: 'Success!', ptText: 'Sucesso!'); + showUploadMessage(context, message); } else { setState(() {}); - showUploadMessage(context, 'Failed to upload data'); + final message = FFLocalizations.of(context) + .getVariableText( + enText: 'Failed to upload data', + ptText: 'Falha ao enviar dados'); + showUploadMessage(context, message); return; } } 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 6c99d9a6..e7578d45 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -45,88 +45,127 @@ 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 isChecked() async { + return StorageUtil().cliUUID.isNotEmpty && + StorageUtil().cliName.isNotEmpty && + StorageUtil().devUUID.isNotEmpty && + StorageUtil().userUUID.isNotEmpty; } - Future scheduleCompleteVisitAction(BuildContext context) async { - context.push( - '/scheduleCompleteVisitPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + Future openQRCodeScanner(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future deliverySchedule(BuildContext context) async { + Future openCompleteSchedule(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/scheduleCompleteVisitPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); + } + + Future openDeliverySchedule(BuildContext context) async { final bool isProvisional = StorageUtil().provisional; - if (isProvisional == true) { - context.push( - '/deliverySchedule', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } else { - DialogUnavailable.unavailableFeature(context); - } + isChecked().then((value) { + if (value) { + if (isProvisional == true) { + context.push( + '/deliverySchedule', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableFeature(context); + } + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future provisionalSchedule(BuildContext context) async { + Future openProvisionalSchedule(BuildContext context) async { final isProvisional = StorageUtil().provisional; - if (isProvisional == true) { - context.push( - '/provisionalSchedule', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } else { - DialogUnavailable.unavailableFeature(context); - } + + isChecked().then((value) { + if (value) { + if (isProvisional == true) { + context.push( + '/provisionalSchedule', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableFeature(context); + } + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future fastPassAction(BuildContext context) async { + Future openFastPassSchedule(BuildContext context) async { final isWpp = StorageUtil().whatsapp; - if (isWpp) { - context.push( - '/fastPassPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } else { - DialogUnavailable.unavailableFeature(context); - } + + isChecked().then((value) { + if (value) { + if (isWpp) { + context.push( + '/fastPassPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableFeature(context); + } + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future scheduleVisitOptAction(BuildContext context) async { + Future showSchedules(BuildContext context) async { final routesListStr = [ 'scheduleProvisionalVisitPage', 'fastPassPage', @@ -167,29 +206,42 @@ class MenuComponentModel extends FlutterFlowModel { ); } - Future registerVisitorOptAction(BuildContext context) async { - context.push( - '/registerVisitorPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + Future openVisitorsRegister(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/registerVisitorPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future peopleOnThePropertyAction(BuildContext context) async { - context.push( - '/peopleOnThePropertyPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); + Future openPoepleOnTheProperty(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/peopleOnThePropertyPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } Future signOut(BuildContext context) async { @@ -217,57 +269,76 @@ class MenuComponentModel extends FlutterFlowModel { }); } - Future preferencesSettings(BuildContext context) async { - context.push( - '/preferencesSettings', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + Future openPreferencesSettings(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/preferencesSettings', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future packageOrder(BuildContext context) async { + Future openMyOrders(BuildContext context) async { final isWpp = StorageUtil().whatsapp; - if (isWpp) { - context.push( - '/packageOrder', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } else { - DialogUnavailable.unavailableFeature(context); - } + isChecked().then((value) { + if (value) { + if (isWpp) { + context.push( + '/packageOrder', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableFeature(context); + } + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future reservation(BuildContext context) async { + Future openReservations(BuildContext context) async { final isWpp = StorageUtil().whatsapp; - if (isWpp) { - context.push( - '/reservation', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } else { - DialogUnavailable.unavailableFeature(context); - } + + isChecked().then((value) { + if (value) { + if (isWpp) { + context.push( + '/reservation', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableFeature(context); + } + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future consultHistoriesAction(BuildContext context) async { + Future showHistories(BuildContext context) async { await showAdaptiveDialog( // isScrollControlled: true, // backgroundColor: Colors.transparent, @@ -313,73 +384,104 @@ class MenuComponentModel extends FlutterFlowModel { ); } - Future liberationHistoryAction(BuildContext context) async { - context.push( - '/liberationHistory', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + Future openLiberationsHistory(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/liberationHistory', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future accessHistoryAction(BuildContext context) async { - context.push( - '/acessHistoryPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + Future openAccessHistory(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/acessHistoryPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future visitHistoryAction(BuildContext context) async { - context.push( - '/scheduleCompleteVisitPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + Future openVisitsHistory(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/scheduleCompleteVisitPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future messageHistoryAction(BuildContext context) async { - context.push( - '/messageHistoryPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + Future openMessagesHistory(BuildContext context) async { + isChecked().then((value) { + if (value) { + context.push( + '/messageHistoryPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } - Future petsAction(BuildContext context) async { + Future openPetsRegister(BuildContext context) async { bool isPet = StorageUtil().pets; - if (isPet) { - context.push( - '/petsPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } else { - DialogUnavailable.unavailableFeature(context); - } + + isChecked().then((value) { + if (value) { + if (isPet) { + context.push( + '/petsPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } else { + DialogUnavailable.unavailableFeature(context); + } + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); } } 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 22c4710c..032ca758 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -60,7 +60,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: FFIcons.kvector1, action: () async { - await _model.scheduleVisitOptAction(context); + await _model.showSchedules(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -71,7 +71,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: FFIcons.khome, action: () async { - await _model.registerVisitorOptAction(context); + await _model.openVisitorsRegister(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -82,7 +82,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.qr_code, action: () async { - await _model.accessQRCodeOptAction(context); + await _model.openQRCodeScanner(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -93,7 +93,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.pets, action: () async { - await _model.petsAction(context); + await _model.openPetsRegister(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -104,7 +104,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.people, action: () async { - await _model.peopleOnThePropertyAction(context); + await _model.openPoepleOnTheProperty(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -115,7 +115,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.history_sharp, action: () async { - await _model.consultHistoriesAction(context); + await _model.showHistories(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -126,7 +126,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.settings, action: () async { - await _model.preferencesSettings(context); + await _model.openPreferencesSettings(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -140,7 +140,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.engineering_outlined, action: () async { - await _model.provisionalSchedule(context); + await _model.openProvisionalSchedule(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -151,7 +151,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.sports_motorsports_outlined, action: () async { - await _model.deliverySchedule(context); + await _model.openDeliverySchedule(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -162,7 +162,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.attach_email_outlined, action: () async { - await _model.fastPassAction(context); + await _model.openFastPassSchedule(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -173,7 +173,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.event, action: () async { - await _model.scheduleCompleteVisitAction(context); + await _model.openCompleteSchedule(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -184,7 +184,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.inventory_2_outlined, action: () async { - await _model.packageOrder(context); + await _model.openMyOrders(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -195,7 +195,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.event_available, action: () async { - await _model.reservation(context); + await _model.openReservations(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -206,7 +206,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.person_add_alt_1_outlined, action: () async { - await _model.registerVisitorOptAction(context); + await _model.openVisitorsRegister(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -217,7 +217,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.qr_code, action: () async { - await _model.accessQRCodeOptAction(context); + await _model.openQRCodeScanner(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -228,7 +228,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.pets, action: () async { - await _model.petsAction(context); + await _model.openPetsRegister(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -239,7 +239,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.transfer_within_a_station_outlined, action: () async { - await _model.accessHistoryAction(context); + await _model.openAccessHistory(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -250,7 +250,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.how_to_reg_outlined, action: () async { - await _model.liberationHistoryAction(context); + await _model.openLiberationsHistory(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -261,7 +261,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.chat_outlined, action: () async { - await _model.messageHistoryAction(context); + await _model.openMessagesHistory(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -272,7 +272,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.groups, action: () async { - await _model.peopleOnThePropertyAction(context); + await _model.openPoepleOnTheProperty(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -283,7 +283,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.settings, action: () async { - await _model.preferencesSettings(context); + await _model.openPreferencesSettings(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -298,7 +298,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: FFIcons.kvector1, action: () async { - await _model.scheduleVisitOptAction(context); + await _model.showSchedules(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -309,7 +309,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: FFIcons.khome, action: () async { - await _model.registerVisitorOptAction(context); + await _model.openVisitorsRegister(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -320,7 +320,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.qr_code, action: () async { - await _model.accessQRCodeOptAction(context); + await _model.openQRCodeScanner(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -331,7 +331,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.people, action: () async { - await _model.peopleOnThePropertyAction(context); + await _model.openPoepleOnTheProperty(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -342,7 +342,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.history_sharp, action: () async { - await _model.consultHistoriesAction(context); + await _model.showHistories(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -353,7 +353,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.inventory_2_rounded, action: () async { - await _model.packageOrder(context); + await _model.openMyOrders(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -364,7 +364,7 @@ class _MenuComponentWidgetState extends State { MenuButtonWidget( icon: Icons.pets, action: () async { - await _model.petsAction(context); + await _model.openPetsRegister(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -375,7 +375,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.event_available, action: () async { - await _model.reservation(context); + await _model.openReservations(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -386,7 +386,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.settings, action: () async { - await _model.preferencesSettings(context); + await _model.openPreferencesSettings(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -401,7 +401,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.engineering_outlined, action: () async { - await _model.provisionalSchedule(context); + await _model.openProvisionalSchedule(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -412,7 +412,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.sports_motorsports_outlined, action: () async { - await _model.deliverySchedule(context); + await _model.openDeliverySchedule(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -423,7 +423,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.attach_email_outlined, action: () async { - await _model.fastPassAction(context); + await _model.openFastPassSchedule(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -434,7 +434,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.event, action: () async { - await _model.scheduleCompleteVisitAction(context); + await _model.openCompleteSchedule(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -445,7 +445,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.inventory_2_outlined, action: () async { - await _model.packageOrder(context); + await _model.openMyOrders(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -456,7 +456,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.event_available, action: () async { - await _model.reservation(context); + await _model.openReservations(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -467,7 +467,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.person_add_alt_1_outlined, action: () async { - await _model.registerVisitorOptAction(context); + await _model.openVisitorsRegister(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -478,7 +478,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.qr_code, action: () async { - await _model.accessQRCodeOptAction(context); + await _model.openQRCodeScanner(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -489,7 +489,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.pets, action: () async { - await _model.petsAction(context); + await _model.openPetsRegister(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -500,7 +500,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.transfer_within_a_station_outlined, action: () async { - await _model.accessHistoryAction(context); + await _model.openAccessHistory(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -511,7 +511,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.how_to_reg_outlined, action: () async { - await _model.liberationHistoryAction(context); + await _model.openLiberationsHistory(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -522,7 +522,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.chat_outlined, action: () async { - await _model.messageHistoryAction(context); + await _model.openMessagesHistory(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -533,7 +533,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.groups, action: () async { - await _model.peopleOnThePropertyAction(context); + await _model.openPoepleOnTheProperty(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( @@ -544,7 +544,7 @@ class _MenuComponentWidgetState extends State { MenuCardItem( icon: Icons.settings, action: () async { - await _model.preferencesSettings(context); + await _model.openPreferencesSettings(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 924af967..cc58b32e 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -531,9 +531,15 @@ class _RegisiterVistorTemplateComponentWidgetState []; try { + final message = + FFLocalizations.of(context) + .getVariableText( + enText: 'Uploading file...', + ptText: 'Enviando arquivo...', + ); showUploadMessage( context, - 'Uploading file...', + message, showLoading: true, ); selectedUploadedFiles = selectedMedia @@ -558,11 +564,22 @@ class _RegisiterVistorTemplateComponentWidgetState _model.uploadedLocalFile = selectedUploadedFiles.first; }); - showUploadMessage(context, 'Success!'); + final String message = + FFLocalizations.of(context) + .getVariableText( + enText: 'File uploaded successfully', + ptText: 'Arquivo enviado com sucesso', + ); + showUploadMessage(context, message); } else { setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); + final String message = + FFLocalizations.of(context) + .getVariableText( + enText: 'Failed to upload data', + ptText: 'Falha ao enviar os dados', + ); + showUploadMessage(context, message); return; } } diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index b9c3de57..d936206c 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -209,6 +209,13 @@ Future?> selectMediaWithSourceBottomSheetandFaceDetection({ DialogUtil.error(context, message); return null; } + if (faces.length > 1) { + final String message = FFLocalizations.of(context).getVariableText( + ptText: "Mais de uma face detectada na imagem", + enText: "More than one face detected in the image"); + DialogUtil.error(context, message); + return null; + } } return selectedMedia; diff --git a/lib/shared/extensions/dialog_extensions.dart b/lib/shared/extensions/dialog_extensions.dart index a2a571f0..b4c4e86b 100644 --- a/lib/shared/extensions/dialog_extensions.dart +++ b/lib/shared/extensions/dialog_extensions.dart @@ -13,4 +13,13 @@ extension DialogUnavailable on DialogUtil { "This functionality is not available for this location. Please select another location or contact the responsible parties to change the contract plan for your location."); return DialogUtil.warning(context, message); } + + static Future unavailableCredentials(BuildContext context) { + final message = FFLocalizations.of(context).getVariableText( + ptText: + "Credenciais inválidas. Selecione um local ou faça o login novamente.", + enText: "Invalid credentials. Select a location or log in again.", + ); + return DialogUtil.warning(context, message); + } }