Merge remote-tracking branch 'origin/fusion-app' into legacy
# Conflicts: # apps/mobile_app/lib/save_family_app.dart # packages/sf_localizations/assets/l10n/de.json # packages/sf_localizations/assets/l10n/en.json # packages/sf_localizations/assets/l10n/es.json # packages/sf_localizations/assets/l10n/fr.json # packages/sf_localizations/assets/l10n/it.json # packages/sf_localizations/assets/l10n/pt.json # packages/sf_localizations/lib/src/generated/i18n.dart
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,
|
||||
};
|
||||
|
||||
@@ -703,9 +703,7 @@
|
||||
"wifiBssid": "MAC address (BSSID)",
|
||||
"wifiSsidHint": "e.g. MyHomeWiFi",
|
||||
"wifiBssidHint": "e.g. 0c:80:63:e4:cb:e1",
|
||||
"deleteContactMessage": "Are you sure you want to delete this phone from the list?"
|
||||
"activationKeyLabel": "Activation key",
|
||||
"editChildProfile": "Edit profile",
|
||||
"editChildProfileTitle": "Edit child profile",
|
||||
"editChildProfileSaveSuccess": "Child profile updated successfully"
|
||||
"editChildProfileSaveSuccess": "Child profile updated successfully",
|
||||
"editChildProfileTitle": "Edit child profile"
|
||||
}
|
||||
@@ -701,8 +701,6 @@
|
||||
"wifiBssid": "Dirección MAC (BSSID)",
|
||||
"wifiSsidHint": "ej. MiWiFiCasa",
|
||||
"wifiBssidHint": "ej. 0c:80:63:e4:cb:e1",
|
||||
"deleteContactMessage": "¿Estás seguro de que deseas eliminar este número de la lista?"
|
||||
"activationKeyLabel": "Clave de activación",
|
||||
"editChildProfile": "Editar perfil",
|
||||
"editChildProfileTitle": "Editar perfil del niño",
|
||||
"editChildProfileSaveSuccess": "Perfil del niño actualizado correctamente"
|
||||
|
||||
@@ -594,7 +594,6 @@
|
||||
"wifiBssid": "Adresse MAC (BSSID)",
|
||||
"wifiSsidHint": "ex. MonWiFiMaison",
|
||||
"wifiBssidHint": "ex. 0c:80:63:e4:cb:e1",
|
||||
"activationKeyLabel": "Clé d'activation",
|
||||
"editChildProfile": "Modifier le profil",
|
||||
"editChildProfileTitle": "Modifier le profil de l'enfant",
|
||||
"editChildProfileSaveSuccess": "Profil de l'enfant mis à jour avec succès"
|
||||
|
||||
@@ -594,7 +594,6 @@
|
||||
"wifiBssid": "Indirizzo MAC (BSSID)",
|
||||
"wifiSsidHint": "es. MiaReteCasa",
|
||||
"wifiBssidHint": "es. 0c:80:63:e4:cb:e1",
|
||||
"activationKeyLabel": "Chiave di attivazione",
|
||||
"editChildProfile": "Modifica profilo",
|
||||
"editChildProfileTitle": "Modifica profilo del bambino",
|
||||
"editChildProfileSaveSuccess": "Profilo del bambino aggiornato con successo"
|
||||
|
||||
@@ -594,7 +594,6 @@
|
||||
"wifiBssid": "Endereço MAC (BSSID)",
|
||||
"wifiSsidHint": "ex. MinhaRedeWiFi",
|
||||
"wifiBssidHint": "ex. 0c:80:63:e4:cb:e1",
|
||||
"activationKeyLabel": "Chave de ativação",
|
||||
"editChildProfile": "Editar perfil",
|
||||
"editChildProfileTitle": "Editar perfil da criança",
|
||||
"editChildProfileSaveSuccess": "Perfil da criança atualizado com sucesso"
|
||||
|
||||
Reference in New Issue
Block a user