From 82e6eb6f187bf007ffe05f746b730ff33b18547e Mon Sep 17 00:00:00 2001 From: Gerardo Guijarro Date: Mon, 14 Aug 2023 16:29:01 -0600 Subject: [PATCH] Fix splash screen issue --- ios/Podfile.lock | 2 +- lib/app.dart | 4 ++-- lib/ui/splash/splash_page.dart | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index dc570914..a6761e5b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1067,4 +1067,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: d60f8e2e421d286a4337134adead709daf32f131 -COCOAPODS: 1.12.1 +COCOAPODS: 1.11.3 diff --git a/lib/app.dart b/lib/app.dart index ce3e946f..db0be0bd 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -69,10 +69,10 @@ class HyphaAppView extends StatelessWidget { LogHelper.d('Auth Bloc Listener unknown'); break; case Authenticated _: - Get.offAll(() => const HyphaBottomNavigation()); + Get.offAll(() => const SplashPage()); break; case UnAuthenticated _: - Get.offAll(() => const OnboardingPage()); + Get.offAll(() => const SplashPage()); break; } }, diff --git a/lib/ui/splash/splash_page.dart b/lib/ui/splash/splash_page.dart index 7e8d12d3..8479a6a4 100644 --- a/lib/ui/splash/splash_page.dart +++ b/lib/ui/splash/splash_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:get_it/get_it.dart'; import 'package:hypha_wallet/core/network/repository/auth_repository.dart'; +import 'package:hypha_wallet/design/hypha_colors.dart'; import 'package:hypha_wallet/ui/bottom_navigation/hypha_bottom_navigation.dart'; import 'package:hypha_wallet/ui/onboarding/onboarding_page.dart'; import 'package:lottie/lottie.dart'; @@ -26,7 +27,7 @@ class _SplashPageState extends State with TickerProviderStateMixin { @override void dispose() { - _controller.dispose(); // you need this + _controller.dispose(); super.dispose(); } @@ -35,9 +36,11 @@ class _SplashPageState extends State with TickerProviderStateMixin { return Scaffold( extendBodyBehindAppBar: true, body: Lottie.asset( + fit: BoxFit.fill, 'assets/animations/hypha_splash.json', controller: _controller, height: MediaQuery.of(context).size.height * 1, + width: MediaQuery.of(context).size.width * 1, animate: true, onLoaded: (composition) { _controller @@ -46,11 +49,11 @@ class _SplashPageState extends State with TickerProviderStateMixin { final userAuthData = GetIt.I.get().currentAuthStatus; if (userAuthData is Authenticated) { if (Get.currentRoute != '/HyphaBottomNavigation') { - Get.offAll(const HyphaBottomNavigation()); + Get.offAll(() => const HyphaBottomNavigation()); } } else { if (Get.currentRoute != '/OnboardingPage') { - Get.offAll(const OnboardingPage()); + Get.offAll(() => const OnboardingPage()); } } });