flutter-freaccess-hub/lib/features/menu/presentation/mappers/menu_entry.dart

259 lines
8.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:hub/features/module/index.dart';
import 'package:hub/flutter_flow/internationalization.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:material_symbols_icons/symbols.dart';
enum MenuEntryType { Home, Drawer, Property }
class MenuEntry implements BaseModule {
final String key;
final IconData icon;
final String name;
final String route;
final List<MenuEntryType> types;
const MenuEntry({
required this.key,
required this.icon,
required this.name,
required this.route,
required this.types,
});
static List<MenuEntry> entries = [
MenuEntry(
key: 'FRE-HUB-AGE-PROV-PREST',
icon: Icons.engineering_outlined,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Agendar Prestadores',
enText: 'Schedule Providers',
),
route: '/provisionalSchedule',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-AGE-PROV-DELIVERY',
icon: Icons.sports_motorsports_outlined,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Agendar Entregas',
enText: 'Delivery Schedule',
),
route: '/deliverySchedule',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-FASTPASS',
icon: Icons.attach_email_outlined,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Convidar Visitante',
enText: 'Invite Visitor',
),
route: '/fastPassPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-COMPLETE-SCHEDULE',
icon: Icons.event,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Agenda Completa',
enText: 'Complete Schedule',
),
route: '/scheduleCompleteVisitPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-RESIDENTS',
icon: Icons.groups,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Moradores',
enText: 'Residents',
),
route: '/residentsOnThePropertyPage',
types: [MenuEntryType.Property],
),
MenuEntry(
key: 'FRE-HUB-VEHICLES',
icon: Icons.directions_car,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Veículos',
enText: 'Vehicles',
),
route: '/vehiclesOnThePropertyPage',
types: [MenuEntryType.Property],
),
MenuEntry(
key: 'FRE-HUB-OPENED-VISITS',
icon: Icons.perm_contact_calendar,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Visitas Abertas',
enText: 'Opened Visits',
),
route: '/visitsOnThePropertyPage',
types: [MenuEntryType.Property],
),
MenuEntry(
key: 'FRE-HUB-PETS-HISTORY',
icon: Icons.pets,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Pets',
enText: 'Pets',
),
route: '/petsOnThePropertyPage',
types: [MenuEntryType.Property],
),
MenuEntry(
key: 'FRE-HUB-ORDERS',
icon: Icons.inventory_2_outlined,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Encomendas',
enText: 'Orders',
),
route: '/packageOrder',
types: [MenuEntryType.Home, MenuEntryType.Drawer, MenuEntryType.Property],
),
MenuEntry(
key: 'FRE-HUB-RESERVATIONS',
icon: Icons.event_available,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Reservas',
enText: 'Reservations',
),
route: '/reservation',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-VISITORS',
icon: Icons.person_add_alt_1_outlined,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Cadastrar Visitantes',
enText: 'Register Visitors',
),
route: '/registerVisitorPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-QRCODE',
icon: Icons.qr_code,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'QRCode de Acesso',
enText: 'Access QRCode',
),
route: '/qrCodePage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-PETS',
icon: Icons.pets,
name: FFLocalizations.of(navigatorKey.currentContext!)
.getVariableText(ptText: 'Cadastrar Pets', enText: 'Pets Register'),
route: '/petsPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-ACCESS',
icon: Icons.transfer_within_a_station_outlined,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Consultar Acessos',
enText: 'Access History',
),
route: '/acessHistoryPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-DOCUMENT',
icon: Icons.document_scanner,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Documentos',
enText: 'Documents',
),
route: '/documentPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-LIBERATIONS',
icon: Icons.how_to_reg_outlined,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Consultar Liberações',
enText: 'Liberations History',
),
route: '/liberationHistory',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-PROVISIONAL-HISTORY',
icon: Symbols.calendar_clock,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Consultar Agendas',
enText: 'Provisional History',
),
route: '/provisionalHistoryPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-MESSAGES',
icon: Icons.chat_outlined,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Consultar Mensagens',
enText: 'Messages History',
),
route: '/messageHistoryPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-ABOUT-PROPERTY',
icon: Icons.home,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Sobre a Propriedade',
enText: 'About the Property',
),
route: '/aboutProperty',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-PEOPLE',
icon: Icons.groups,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Pessoas na Propriedade',
enText: 'People on the Property',
),
route: '/peopleOnThePropertyPage',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-SETTINGS',
icon: Icons.settings,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Opções do Sistema',
enText: 'System Settings',
),
route: '/preferencesSettings',
types: [MenuEntryType.Home, MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-ABOUT-SYSTEM',
icon: Icons.info_outline,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Sobre o Sistema',
enText: 'About the System',
),
route: '/aboutSystemPage',
types: [MenuEntryType.Drawer],
),
MenuEntry(
key: 'FRE-HUB-LOGOUT',
icon: Icons.exit_to_app,
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
ptText: 'Sair',
enText: 'Logout',
),
route: '/WelcomePage',
types: [MenuEntryType.Drawer],
),
];
static List<MenuEntry> getEntriesByType(MenuEntryType type) {
return entries.where((entry) => entry.types.contains(type)).toList();
}
}