This commit is contained in:
J. A. Messias 2024-10-01 09:30:27 -03:00
parent 267ab3c4ab
commit 5445e5b820
6 changed files with 388 additions and 242 deletions

View File

@ -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<MediaUploadButtonUtil> {
var selectedUploadedFiles = <FFUploadedFile>[];
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<MediaUploadButtonUtil> {
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;
}
}

View File

@ -45,7 +45,16 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
isGrid = !isGrid;
}
Future accessQRCodeOptAction(BuildContext context) async {
Future<bool> isChecked() async {
return StorageUtil().cliUUID.isNotEmpty &&
StorageUtil().cliName.isNotEmpty &&
StorageUtil().devUUID.isNotEmpty &&
StorageUtil().userUUID.isNotEmpty;
}
Future openQRCodeScanner(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/qrCodePage',
extra: <String, dynamic>{
@ -56,9 +65,15 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future scheduleCompleteVisitAction(BuildContext context) async {
Future openCompleteSchedule(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/scheduleCompleteVisitPage',
extra: <String, dynamic>{
@ -69,11 +84,17 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future deliverySchedule(BuildContext context) async {
Future openDeliverySchedule(BuildContext context) async {
final bool isProvisional = StorageUtil().provisional;
isChecked().then((value) {
if (value) {
if (isProvisional == true) {
context.push(
'/deliverySchedule',
@ -88,10 +109,17 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
} else {
DialogUnavailable.unavailableFeature(context);
}
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future provisionalSchedule(BuildContext context) async {
Future openProvisionalSchedule(BuildContext context) async {
final isProvisional = StorageUtil().provisional;
isChecked().then((value) {
if (value) {
if (isProvisional == true) {
context.push(
'/provisionalSchedule',
@ -106,10 +134,17 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
} else {
DialogUnavailable.unavailableFeature(context);
}
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future fastPassAction(BuildContext context) async {
Future openFastPassSchedule(BuildContext context) async {
final isWpp = StorageUtil().whatsapp;
isChecked().then((value) {
if (value) {
if (isWpp) {
context.push(
'/fastPassPage',
@ -124,9 +159,13 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
} else {
DialogUnavailable.unavailableFeature(context);
}
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future scheduleVisitOptAction(BuildContext context) async {
Future showSchedules(BuildContext context) async {
final routesListStr = <String>[
'scheduleProvisionalVisitPage',
'fastPassPage',
@ -167,7 +206,9 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
);
}
Future registerVisitorOptAction(BuildContext context) async {
Future openVisitorsRegister(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/registerVisitorPage',
extra: <String, dynamic>{
@ -178,18 +219,29 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future peopleOnThePropertyAction(BuildContext context) async {
Future openPoepleOnTheProperty(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/peopleOnThePropertyPage',
extra: <String, dynamic>{
kTransitionInfoKey: const TransitionInfo(
hasTransition: true,
transitionType: PageTransitionType.fade,
transitionType: PageTransitionType.scale,
alignment: Alignment.bottomCenter,
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future<void> signOut(BuildContext context) async {
@ -217,7 +269,9 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
});
}
Future preferencesSettings(BuildContext context) async {
Future openPreferencesSettings(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/preferencesSettings',
extra: <String, dynamic>{
@ -228,11 +282,17 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future packageOrder(BuildContext context) async {
Future openMyOrders(BuildContext context) async {
final isWpp = StorageUtil().whatsapp;
isChecked().then((value) {
if (value) {
if (isWpp) {
context.push(
'/packageOrder',
@ -247,10 +307,17 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
} else {
DialogUnavailable.unavailableFeature(context);
}
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future reservation(BuildContext context) async {
Future openReservations(BuildContext context) async {
final isWpp = StorageUtil().whatsapp;
isChecked().then((value) {
if (value) {
if (isWpp) {
context.push(
'/reservation',
@ -265,9 +332,13 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
} 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,7 +384,9 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
);
}
Future liberationHistoryAction(BuildContext context) async {
Future openLiberationsHistory(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/liberationHistory',
extra: <String, dynamic>{
@ -324,9 +397,15 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future accessHistoryAction(BuildContext context) async {
Future openAccessHistory(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/acessHistoryPage',
extra: <String, dynamic>{
@ -337,9 +416,15 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future visitHistoryAction(BuildContext context) async {
Future openVisitsHistory(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/scheduleCompleteVisitPage',
extra: <String, dynamic>{
@ -350,9 +435,15 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future messageHistoryAction(BuildContext context) async {
Future openMessagesHistory(BuildContext context) async {
isChecked().then((value) {
if (value) {
context.push(
'/messageHistoryPage',
extra: <String, dynamic>{
@ -363,10 +454,17 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
),
},
);
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
Future petsAction(BuildContext context) async {
Future openPetsRegister(BuildContext context) async {
bool isPet = StorageUtil().pets;
isChecked().then((value) {
if (value) {
if (isPet) {
context.push(
'/petsPage',
@ -381,5 +479,9 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
} else {
DialogUnavailable.unavailableFeature(context);
}
} else {
DialogUnavailable.unavailableCredentials(context);
}
});
}
}

View File

@ -60,7 +60,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
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<MenuComponentWidget> {
MenuCardItem(
icon: Icons.settings,
action: () async {
await _model.preferencesSettings(context);
await _model.openPreferencesSettings(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(

View File

@ -531,9 +531,15 @@ class _RegisiterVistorTemplateComponentWidgetState
<FFUploadedFile>[];
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;
}
}

View File

@ -209,6 +209,13 @@ Future<List<SelectedFile>?> 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;

View File

@ -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<dynamic> 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);
}
}