68 lines
2.2 KiB
Dart
68 lines
2.2 KiB
Dart
import 'package:animated_splash_screen/animated_splash_screen.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:lottie/lottie.dart';
|
|
import 'package:sigap/src/features/onboarding/screens/onboarding/onboarding_screen.dart';
|
|
import 'package:sigap/src/utils/constants/colors.dart';
|
|
import 'package:sigap/src/utils/constants/image_strings.dart';
|
|
import 'package:sigap/src/utils/helpers/helper_functions.dart';
|
|
|
|
class AnimatedSplashScreenWidget extends StatelessWidget {
|
|
const AnimatedSplashScreenWidget({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isDark = THelperFunctions.isDarkMode(context);
|
|
|
|
// Try to find SplashController, but don't fail if it's not ready yet
|
|
// SplashController? splashController;
|
|
// if (Get.isRegistered<SplashController>()) {
|
|
// splashController = Get.find<SplashController>();
|
|
// } else {
|
|
// // Register a temporary controller if the real one isn't ready
|
|
// splashController = Get.put(SplashController());
|
|
// }
|
|
|
|
return AnimatedSplashScreen(
|
|
splash: Center(
|
|
child: Lottie.asset(
|
|
isDark ? TImages.darkSplashApp : TImages.lightSplashApp,
|
|
frameRate: FrameRate.max,
|
|
repeat: true,
|
|
|
|
),
|
|
),
|
|
splashIconSize: 300,
|
|
duration: 3500,
|
|
nextScreen: const OnboardingScreen(),
|
|
backgroundColor: isDark ? TColors.dark : TColors.white,
|
|
);
|
|
}
|
|
}
|
|
|
|
// A transition screen that shows a loading indicator
|
|
// until authentication is ready
|
|
// class _LoadingScreen extends StatelessWidget {
|
|
// const _LoadingScreen();
|
|
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// final isDark = THelperFunctions.isDarkMode(context);
|
|
|
|
// // This will be shown after the animated splash screen
|
|
// // while we wait for initialization to complete
|
|
// return Scaffold(
|
|
// backgroundColor: isDark ? TColors.dark : TColors.white,
|
|
// body: const Center(
|
|
// child: Column(
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
// children: [
|
|
// CircularProgressIndicator(),
|
|
// SizedBox(height: 24),
|
|
// Text("Menyiapkan aplikasi..."),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// );
|
|
// }
|
|
// }
|