navigation fixes
This commit is contained in:
@@ -47,12 +47,21 @@ class SaveFamilyAppState extends ConsumerState<SaveFamilyApp>
|
||||
walletHeartbeat.stop();
|
||||
legacyHeartbeat.stop();
|
||||
};
|
||||
// walletHeartbeat.start();
|
||||
legacyHeartbeat.start();
|
||||
appRouter.routerDelegate.addListener(_onRouteChanged);
|
||||
}
|
||||
|
||||
void _onRouteChanged() {
|
||||
final location = appRouter.routerDelegate.currentConfiguration.uri.path;
|
||||
if (location.startsWith(AppRoutes.legacyDashboard)) {
|
||||
legacyHeartbeat.start();
|
||||
} else {
|
||||
legacyHeartbeat.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
appRouter.routerDelegate.removeListener(_onRouteChanged);
|
||||
walletHeartbeat.stop();
|
||||
legacyHeartbeat.stop();
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
@@ -65,7 +74,7 @@ class SaveFamilyAppState extends ConsumerState<SaveFamilyApp>
|
||||
ref.read(appLifecycleStateProvider.notifier).setState(state);
|
||||
if (state == AppLifecycleState.resumed) {
|
||||
// walletHeartbeat.start();
|
||||
legacyHeartbeat.start();
|
||||
_onRouteChanged();
|
||||
ref.read(permissionsProvider.notifier).checkPermissions();
|
||||
} else if (state == AppLifecycleState.paused) {
|
||||
// walletHeartbeat.stop();
|
||||
|
||||
@@ -13,28 +13,21 @@ import 'package:utils/utils.dart';
|
||||
class ControlPanelScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
|
||||
const ControlPanelScreen({
|
||||
super.key,
|
||||
required this.navigationContract,
|
||||
});
|
||||
const ControlPanelScreen({super.key, required this.navigationContract});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final state = ref.watch(controlPanelViewModelProvider);
|
||||
|
||||
ref.listen(
|
||||
controlPanelViewModelProvider.select((s) => s.errorMessage),
|
||||
(previous, next) {
|
||||
if (next.isNotEmpty) {
|
||||
showTopSnackbar(
|
||||
context,
|
||||
message: next,
|
||||
type: MessageType.error,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
ref.listen(controlPanelViewModelProvider.select((s) => s.errorMessage), (
|
||||
previous,
|
||||
next,
|
||||
) {
|
||||
if (next.isNotEmpty) {
|
||||
showTopSnackbar(context, message: next, type: MessageType.error);
|
||||
}
|
||||
});
|
||||
|
||||
if (state.isLoading) {
|
||||
return Scaffold(
|
||||
@@ -90,7 +83,9 @@ class _Header extends ConsumerWidget {
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: SizeUtils.getByScreen(small: 14, big: 14)),
|
||||
padding: EdgeInsets.only(
|
||||
top: SizeUtils.getByScreen(small: 14, big: 14),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_shared/sf_shared.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'check_session_use_case.dart';
|
||||
import 'initial_route.dart';
|
||||
@@ -7,10 +8,22 @@ import 'initial_route.dart';
|
||||
class CheckSessionUseCaseImpl implements CheckSessionUseCase {
|
||||
CheckSessionUseCaseImpl(this._userRepository);
|
||||
|
||||
static const _onboardingSeenKey = 'onboarding_seen';
|
||||
|
||||
final UserRepository _userRepository;
|
||||
|
||||
@override
|
||||
Future<InitialRoute> execute() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final onboardingSeen = prefs.getBool(_onboardingSeenKey) ?? false;
|
||||
debugPrint('[CheckSession] onboardingSeen=$onboardingSeen');
|
||||
|
||||
if (!onboardingSeen) {
|
||||
await prefs.setBool(_onboardingSeenKey, true);
|
||||
debugPrint('[CheckSession] → onboarding');
|
||||
return InitialRoute.onboarding;
|
||||
}
|
||||
|
||||
try {
|
||||
await _userRepository.getUserInfo();
|
||||
return InitialRoute.home;
|
||||
|
||||
@@ -1 +1 @@
|
||||
enum InitialRoute { login, home }
|
||||
enum InitialRoute { login, home, onboarding }
|
||||
|
||||
@@ -53,6 +53,7 @@ class _SplashScreenState extends State<SplashScreen>
|
||||
if (!_animationDone || _route == null || !mounted) return;
|
||||
|
||||
final destination = switch (_route!) {
|
||||
InitialRoute.onboarding => AppRoutes.legacyOnboarding,
|
||||
InitialRoute.login => AppRoutes.legacyLogin,
|
||||
InitialRoute.home => AppRoutes.controlPanel,
|
||||
};
|
||||
|
||||
@@ -574,5 +574,24 @@
|
||||
"wifiSsid": "Netzwerkname (SSID)",
|
||||
"wifiBssid": "MAC-Adresse (BSSID)",
|
||||
"wifiSsidHint": "z.B. MeinHeimWLAN",
|
||||
"wifiBssidHint": "z.B. 0c:80:63:e4:cb:e1"
|
||||
"wifiBssidHint": "z.B. 0c:80:63:e4:cb:e1",
|
||||
"transactionBankDirectDebit": "Lastschrift",
|
||||
"transactionBankTransfer": "Banküberweisung",
|
||||
"transactionCardTopup": "Kartenaufladung",
|
||||
"transactionCheck": "Scheck",
|
||||
"transactionCreditNote": "Gutschrift",
|
||||
"transactionFees": "Gebühren",
|
||||
"transactionInstantBankTransfer": "Sofortüberweisung",
|
||||
"transactionWalletTransfer": "Kontotransfer",
|
||||
"editChildProfile": "Profil bearbeiten",
|
||||
"editChildProfileSaveSuccess": "Kinderprofil erfolgreich aktualisiert",
|
||||
"editChildProfileTitle": "Kinderprofil bearbeiten",
|
||||
"deleteDeviceChecking": "Überprüfung...",
|
||||
"deleteDeviceNotAllowedTitle": "Löschen nicht möglich",
|
||||
"deleteDeviceWalletNonZeroBalance": "Das Profil kann nicht gelöscht werden, da das Wallet ein verfügbares Guthaben hat",
|
||||
"profileSettingsCity": "Stadt",
|
||||
"profileSettingsLastName": "Nachname",
|
||||
"profileSettingsPostCode": "Postleitzahl",
|
||||
"profileSettingsStreet": "Straße",
|
||||
"profileSettingsSaveSuccess": "Änderungen erfolgreich gespeichert"
|
||||
}
|
||||
@@ -683,5 +683,24 @@
|
||||
"wifiSsid": "Network name (SSID)",
|
||||
"wifiBssid": "MAC address (BSSID)",
|
||||
"wifiSsidHint": "e.g. MyHomeWiFi",
|
||||
"wifiBssidHint": "e.g. 0c:80:63:e4:cb:e1"
|
||||
"wifiBssidHint": "e.g. 0c:80:63:e4:cb:e1",
|
||||
"transactionBankDirectDebit": "Direct debit",
|
||||
"transactionBankTransfer": "Bank transfer",
|
||||
"transactionCardTopup": "Card top-up",
|
||||
"transactionCheck": "Check",
|
||||
"transactionCreditNote": "Credit note",
|
||||
"transactionFees": "Fees",
|
||||
"transactionInstantBankTransfer": "Instant transfer",
|
||||
"transactionWalletTransfer": "Wallet transfer",
|
||||
"editChildProfile": "Edit profile",
|
||||
"editChildProfileSaveSuccess": "Child profile updated successfully",
|
||||
"editChildProfileTitle": "Edit child profile",
|
||||
"deleteDeviceChecking": "Checking...",
|
||||
"deleteDeviceNotAllowedTitle": "Cannot delete",
|
||||
"deleteDeviceWalletNonZeroBalance": "Cannot delete the profile because the wallet has a non-zero balance",
|
||||
"profileSettingsCity": "City",
|
||||
"profileSettingsLastName": "Last name",
|
||||
"profileSettingsPostCode": "Post code",
|
||||
"profileSettingsStreet": "Street",
|
||||
"profileSettingsSaveSuccess": "Changes saved successfully"
|
||||
}
|
||||
@@ -681,5 +681,24 @@
|
||||
"wifiSsid": "Nombre de red (SSID)",
|
||||
"wifiBssid": "Dirección MAC (BSSID)",
|
||||
"wifiSsidHint": "ej. MiWiFiCasa",
|
||||
"wifiBssidHint": "ej. 0c:80:63:e4:cb:e1"
|
||||
"wifiBssidHint": "ej. 0c:80:63:e4:cb:e1",
|
||||
"transactionBankDirectDebit": "Domiciliación bancaria",
|
||||
"transactionBankTransfer": "Transferencia bancaria",
|
||||
"transactionCardTopup": "Recarga con tarjeta",
|
||||
"transactionCheck": "Cheque",
|
||||
"transactionCreditNote": "Nota de crédito",
|
||||
"transactionFees": "Comisiones",
|
||||
"transactionInstantBankTransfer": "Transferencia instantánea",
|
||||
"transactionWalletTransfer": "Transferencia entre cuentas",
|
||||
"editChildProfile": "Editar perfil",
|
||||
"editChildProfileSaveSuccess": "Perfil del niño actualizado correctamente",
|
||||
"editChildProfileTitle": "Editar perfil del niño",
|
||||
"deleteDeviceChecking": "Comprobando...",
|
||||
"deleteDeviceNotAllowedTitle": "No se puede eliminar",
|
||||
"deleteDeviceWalletNonZeroBalance": "No se puede eliminar el perfil porque la cartera tiene saldo disponible",
|
||||
"profileSettingsCity": "Ciudad",
|
||||
"profileSettingsLastName": "Apellido",
|
||||
"profileSettingsPostCode": "Código postal",
|
||||
"profileSettingsStreet": "Calle",
|
||||
"profileSettingsSaveSuccess": "Cambios guardados correctamente"
|
||||
}
|
||||
@@ -574,5 +574,24 @@
|
||||
"wifiSsid": "Nom du réseau (SSID)",
|
||||
"wifiBssid": "Adresse MAC (BSSID)",
|
||||
"wifiSsidHint": "ex. MonWiFiMaison",
|
||||
"wifiBssidHint": "ex. 0c:80:63:e4:cb:e1"
|
||||
"wifiBssidHint": "ex. 0c:80:63:e4:cb:e1",
|
||||
"transactionBankDirectDebit": "Prélèvement bancaire",
|
||||
"transactionBankTransfer": "Virement bancaire",
|
||||
"transactionCardTopup": "Rechargement par carte",
|
||||
"transactionCheck": "Chèque",
|
||||
"transactionCreditNote": "Avoir",
|
||||
"transactionFees": "Frais",
|
||||
"transactionInstantBankTransfer": "Virement instantané",
|
||||
"transactionWalletTransfer": "Transfert entre comptes",
|
||||
"editChildProfile": "Modifier le profil",
|
||||
"editChildProfileSaveSuccess": "Profil de l'enfant mis à jour avec succès",
|
||||
"editChildProfileTitle": "Modifier le profil de l'enfant",
|
||||
"deleteDeviceChecking": "Vérification...",
|
||||
"deleteDeviceNotAllowedTitle": "Suppression impossible",
|
||||
"deleteDeviceWalletNonZeroBalance": "Impossible de supprimer le profil car le portefeuille a un solde disponible",
|
||||
"profileSettingsCity": "Ville",
|
||||
"profileSettingsLastName": "Nom de famille",
|
||||
"profileSettingsPostCode": "Code postal",
|
||||
"profileSettingsStreet": "Rue",
|
||||
"profileSettingsSaveSuccess": "Modifications enregistrées avec succès"
|
||||
}
|
||||
@@ -574,5 +574,24 @@
|
||||
"wifiSsid": "Nome rete (SSID)",
|
||||
"wifiBssid": "Indirizzo MAC (BSSID)",
|
||||
"wifiSsidHint": "es. MiaReteCasa",
|
||||
"wifiBssidHint": "es. 0c:80:63:e4:cb:e1"
|
||||
"wifiBssidHint": "es. 0c:80:63:e4:cb:e1",
|
||||
"transactionBankDirectDebit": "Addebito diretto",
|
||||
"transactionBankTransfer": "Bonifico bancario",
|
||||
"transactionCardTopup": "Ricarica con carta",
|
||||
"transactionCheck": "Assegno",
|
||||
"transactionCreditNote": "Nota di credito",
|
||||
"transactionFees": "Commissioni",
|
||||
"transactionInstantBankTransfer": "Bonifico istantaneo",
|
||||
"transactionWalletTransfer": "Trasferimento tra conti",
|
||||
"editChildProfile": "Modifica profilo",
|
||||
"editChildProfileSaveSuccess": "Profilo del bambino aggiornato con successo",
|
||||
"editChildProfileTitle": "Modifica profilo del bambino",
|
||||
"deleteDeviceChecking": "Verifica in corso...",
|
||||
"deleteDeviceNotAllowedTitle": "Impossibile eliminare",
|
||||
"deleteDeviceWalletNonZeroBalance": "Impossibile eliminare il profilo perché il portafoglio ha un saldo disponibile",
|
||||
"profileSettingsCity": "Città",
|
||||
"profileSettingsLastName": "Cognome",
|
||||
"profileSettingsPostCode": "Codice postale",
|
||||
"profileSettingsStreet": "Via",
|
||||
"profileSettingsSaveSuccess": "Modifiche salvate con successo"
|
||||
}
|
||||
@@ -574,5 +574,24 @@
|
||||
"wifiSsid": "Nome da rede (SSID)",
|
||||
"wifiBssid": "Endereço MAC (BSSID)",
|
||||
"wifiSsidHint": "ex. MinhaRedeWiFi",
|
||||
"wifiBssidHint": "ex. 0c:80:63:e4:cb:e1"
|
||||
"wifiBssidHint": "ex. 0c:80:63:e4:cb:e1",
|
||||
"transactionBankDirectDebit": "Débito direto",
|
||||
"transactionBankTransfer": "Transferência bancária",
|
||||
"transactionCardTopup": "Carregamento com cartão",
|
||||
"transactionCheck": "Cheque",
|
||||
"transactionCreditNote": "Nota de crédito",
|
||||
"transactionFees": "Taxas",
|
||||
"transactionInstantBankTransfer": "Transferência instantânea",
|
||||
"transactionWalletTransfer": "Transferência entre contas",
|
||||
"editChildProfile": "Editar perfil",
|
||||
"editChildProfileSaveSuccess": "Perfil da criança atualizado com sucesso",
|
||||
"editChildProfileTitle": "Editar perfil da criança",
|
||||
"deleteDeviceChecking": "A verificar...",
|
||||
"deleteDeviceNotAllowedTitle": "Não é possível eliminar",
|
||||
"deleteDeviceWalletNonZeroBalance": "Não é possível eliminar o perfil porque a carteira tem saldo disponível",
|
||||
"profileSettingsCity": "Cidade",
|
||||
"profileSettingsLastName": "Apelido",
|
||||
"profileSettingsPostCode": "Código postal",
|
||||
"profileSettingsStreet": "Rua",
|
||||
"profileSettingsSaveSuccess": "Alterações guardadas com sucesso"
|
||||
}
|
||||
@@ -807,4 +807,23 @@ class I18n {
|
||||
static const String wifiBssid = 'wifiBssid';
|
||||
static const String wifiSsidHint = 'wifiSsidHint';
|
||||
static const String wifiBssidHint = 'wifiBssidHint';
|
||||
static const String transactionBankDirectDebit = 'transactionBankDirectDebit';
|
||||
static const String transactionBankTransfer = 'transactionBankTransfer';
|
||||
static const String transactionCardTopup = 'transactionCardTopup';
|
||||
static const String transactionCheck = 'transactionCheck';
|
||||
static const String transactionCreditNote = 'transactionCreditNote';
|
||||
static const String transactionFees = 'transactionFees';
|
||||
static const String transactionInstantBankTransfer = 'transactionInstantBankTransfer';
|
||||
static const String transactionWalletTransfer = 'transactionWalletTransfer';
|
||||
static const String editChildProfile = 'editChildProfile';
|
||||
static const String editChildProfileSaveSuccess = 'editChildProfileSaveSuccess';
|
||||
static const String editChildProfileTitle = 'editChildProfileTitle';
|
||||
static const String deleteDeviceChecking = 'deleteDeviceChecking';
|
||||
static const String deleteDeviceNotAllowedTitle = 'deleteDeviceNotAllowedTitle';
|
||||
static const String deleteDeviceWalletNonZeroBalance = 'deleteDeviceWalletNonZeroBalance';
|
||||
static const String profileSettingsCity = 'profileSettingsCity';
|
||||
static const String profileSettingsLastName = 'profileSettingsLastName';
|
||||
static const String profileSettingsPostCode = 'profileSettingsPostCode';
|
||||
static const String profileSettingsStreet = 'profileSettingsStreet';
|
||||
static const String profileSettingsSaveSuccess = 'profileSettingsSaveSuccess';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user