Skip to content

Commit

Permalink
Fix splash screen issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo Guijarro committed Aug 14, 2023
1 parent 94d8431 commit 82e6eb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1067,4 +1067,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: d60f8e2e421d286a4337134adead709daf32f131

COCOAPODS: 1.12.1
COCOAPODS: 1.11.3
4 changes: 2 additions & 2 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
},
Expand Down
9 changes: 6 additions & 3 deletions lib/ui/splash/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -26,7 +27,7 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin {

@override
void dispose() {
_controller.dispose(); // you need this
_controller.dispose();
super.dispose();
}

Expand All @@ -35,9 +36,11 @@ class _SplashPageState extends State<SplashPage> 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
Expand All @@ -46,11 +49,11 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin {
final userAuthData = GetIt.I.get<AuthRepository>().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());
}
}
});
Expand Down

0 comments on commit 82e6eb6

Please sign in to comment.