diff --git a/assets/images/splash_logo.png b/assets/images/splash_logo.png new file mode 100644 index 0000000..f350a5f Binary files /dev/null and b/assets/images/splash_logo.png differ diff --git a/lib/features/splash/presentation/ui/splash_page.dart b/lib/features/splash/presentation/ui/splash_page.dart index 29031e7..08dbf4c 100644 --- a/lib/features/splash/presentation/ui/splash_page.dart +++ b/lib/features/splash/presentation/ui/splash_page.dart @@ -15,15 +15,37 @@ class SplashPage extends StatefulWidget { State createState() => _SplashPageState(); } -class _SplashPageState extends State { +class _SplashPageState extends State with SingleTickerProviderStateMixin{ + late AnimationController _controller; + late Animation _translateY; + @override void initState() { super.initState(); + + _controller = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 900), + ); + + _translateY = Tween(begin: 40, end: 0).animate( + CurvedAnimation( + parent: _controller, + curve: Curves.easeOutBack, // gives that slight bounce + ), + ); + + _controller.forward(); WidgetsBinding.instance.addPostFrameCallback((_) { context.read().goToHomePage(context); }); } + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } @override Widget build(BuildContext context) { @@ -50,13 +72,29 @@ class _SplashPageState extends State { ), ), ), - child: Stack( - alignment: Alignment.center, - children: [ - Positioned.fill(child: _image()), - _loading(context), - ], + child: Center( + child: AnimatedBuilder( + animation: _translateY, + builder: (context, child) { + return Transform.translate( + offset: Offset(0, _translateY.value), + child: child, + ); + }, + child: Image.asset( + 'assets/images/splash_logo.png', + height: 245, + width: 245, + ), + ), ), + // Stack( + // alignment: Alignment.center, + // children: [ + // Positioned.fill(child: _image()), + // _loading(context), + // ], + // ), ), ); }