diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 4122474..0ff489c 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -8,7 +8,7 @@ plugins { android { namespace = "com.appskel.enaklo" compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion + ndkVersion = "27.0.12077973" compileOptions { sourceCompatibility = JavaVersion.VERSION_11 diff --git a/lib/presentation/pages/splash/splash_page.dart b/lib/presentation/pages/splash/splash_page.dart index 12c890a..eda1666 100644 --- a/lib/presentation/pages/splash/splash_page.dart +++ b/lib/presentation/pages/splash/splash_page.dart @@ -1,7 +1,9 @@ -import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'dart:async'; + +import '../../../common/theme/theme.dart'; +import '../../components/assets/assets.gen.dart'; -@RoutePage() class SplashPage extends StatefulWidget { const SplashPage({super.key}); @@ -9,12 +11,109 @@ class SplashPage extends StatefulWidget { State createState() => _SplashPageState(); } -class _SplashPageState extends State { +class _SplashPageState extends State + with SingleTickerProviderStateMixin { + late AnimationController _logoController; + + late Animation _logoScaleAnimation; + late Animation _logoOpacityAnimation; + + @override + void initState() { + super.initState(); + _initAnimations(); + _startAnimations(); + _navigateToHome(); + } + + void _initAnimations() { + // Logo Animation Controller + _logoController = AnimationController( + duration: const Duration(milliseconds: 1500), + vsync: this, + ); + + // Logo Animations + _logoScaleAnimation = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation(parent: _logoController, curve: Curves.elasticOut), + ); + + _logoOpacityAnimation = Tween( + begin: 0.0, + end: 1.0, + ).animate(CurvedAnimation(parent: _logoController, curve: Curves.easeIn)); + } + + void _startAnimations() { + // Start logo animation + _logoController.forward(); + } + + void _navigateToHome() { + Timer(const Duration(milliseconds: 2500), () { + // Navigate to your main screen here + // Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => HomeScreen())); + print("Navigate to Home Screen"); + }); + } + + @override + void dispose() { + _logoController.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { return Scaffold( - body: Center( - child: Text("Splash Page"), + body: Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [AppColor.backgroundLight, AppColor.background], + ), + ), + child: Center( + child: AnimatedBuilder( + animation: _logoController, + builder: (context, child) { + return Transform.scale( + scale: _logoScaleAnimation.value, + child: Opacity( + opacity: _logoOpacityAnimation.value, + child: Container( + width: 140, + height: 140, + decoration: BoxDecoration( + gradient: const LinearGradient( + colors: AppColor.primaryGradient, + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: AppColor.primaryWithOpacity(0.4), + blurRadius: 25, + offset: const Offset(0, 12), + ), + ], + ), + child: ClipOval( + child: Padding( + padding: const EdgeInsets.all(20), + child: Assets.images.logo.image(fit: BoxFit.contain), + ), + ), + ), + ), + ); + }, + ), + ), ), ); }