diff --git a/lib/main.dart b/lib/main.dart index 56fea02f..d5855ced 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -47,11 +47,9 @@ Future initializeApp() async { Future _initializeTracking() async { await AppTrackingTransparency.requestTrackingAuthorization(); } - Future _initializeFirebase() async { await Firebase.initializeApp(); } - Future _initializeNotificationService() async { await NotificationService.initialize(); } @@ -59,7 +57,6 @@ Future _initializeNotificationService() async { void _initializeUrlStrategy() { setUrlStrategy(PathUrlStrategy()); } - void _initializeSystemSettings() { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); if (kDebugMode) { @@ -78,7 +75,6 @@ Future _initializeFlutterFlow() async { GoRouter.optionURLReflectsImperativeAPIs = true; usePathUrlStrategy(); } - Future _foregroundHandlerMessage(RemoteMessage message) async { if (message.data['click_action'] == 'enroll_cond') { await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage); @@ -92,7 +88,6 @@ Future _foregroundHandlerMessage(RemoteMessage message) async { payload: Map.from(message.data)); } } - Future _backgroundHandlerMessage(RemoteMessage message) async { if (message.data['click_action'] == 'enroll_cond') { await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage); @@ -108,7 +103,6 @@ class App extends StatefulWidget { static _AppState of(BuildContext context) => context.findAncestorStateOfType<_AppState>()!; } - class _AppState extends State with WidgetsBindingObserver { Locale? _locale = FFLocalizations.getStoredLocale(); ThemeMode _themeMode = FlutterFlowTheme.themeMode; @@ -277,7 +271,7 @@ class _AppState extends State with WidgetsBindingObserver { @override void didChangeAppLifecycleState(AppLifecycleState state) async { - if(state == AppLifecycleState.resumed) await _initializeNotificationService(); + if(state == AppLifecycleState.resumed) await LocalizationService.processLocals(context); } @override @@ -296,3 +290,4 @@ class _AppState extends State with WidgetsBindingObserver { ); } } + diff --git a/lib/shared/services/localization/localization_service.dart b/lib/shared/services/localization/localization_service.dart index c42ce787..df0df4c9 100644 --- a/lib/shared/services/localization/localization_service.dart +++ b/lib/shared/services/localization/localization_service.dart @@ -213,11 +213,17 @@ class LocalizationService { // await DialogUtil.error(context, errorMsg).whenComplete(() async => await AuthenticationService.signOut(context)); } else if (isAuthenticated && !isDevLinked) { + final String log = ''' + + devUUID: $devUUID + userUUID: $userUUID + + '''; errorMsg = FFLocalizations.of(context).getVariableText( ptText: 'Não foi possível vincular o dispositivo, tente novamente.', enText: 'Unable to link device, try again', ); - await DialogUtil.warning(context, errorMsg); + await DialogUtil.warning(context, errorMsg+log); } else if (isAuthenticated && isDevLinked) await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context));