import 'package:flutter/material.dart'; import '../services/theme_service.dart'; class SplashScreen extends StatefulWidget { const SplashScreen({super.key}); @override State createState() => _SplashScreenState(); } class _SplashScreenState extends State with SingleTickerProviderStateMixin { late AnimationController _controller; late Animation _fadeIn; late Animation _scale; @override void initState() { super.initState(); _controller = AnimationController( vsync: this, duration: const Duration(milliseconds: 1500), ); _fadeIn = Tween(begin: 0, end: 1).animate( CurvedAnimation(parent: _controller, curve: Curves.easeInOut), ); _scale = Tween(begin: 0.8, end: 1).animate( CurvedAnimation(parent: _controller, curve: Curves.elasticOut), ); _controller.forward(); Future.delayed(const Duration(seconds: 2), () { if (mounted) Navigator.pushReplacementNamed(context, '/login'); }); } @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: ThemeService.backgroundPrimary, body: Center( child: AnimatedBuilder( animation: _controller, builder: (context, child) => Opacity( opacity: _fadeIn.value, child: Transform.scale( scale: _scale.value, child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( width: 100, height: 100, decoration: BoxDecoration( color: ThemeService.primary, borderRadius: BorderRadius.circular(24), boxShadow: [ BoxShadow( color: ThemeService.primary.withValues(alpha: 0.4), blurRadius: 30, spreadRadius: 5, ), ], ), child: const Center( child: Text( 'JAM', style: TextStyle( color: Colors.white, fontSize: 36, fontWeight: FontWeight.w800, letterSpacing: 2, ), ), ), ), const SizedBox(height: 24), const Text( 'JustAMessenger', style: TextStyle( color: ThemeService.textPrimary, fontSize: 28, fontWeight: FontWeight.w700, letterSpacing: 1, ), ), const SizedBox(height: 8), Text( 'Lightweight · Decentralized · Secure', style: TextStyle( color: ThemeService.textSecondary.withValues(alpha: 0.7), fontSize: 14, letterSpacing: 0.5, ), ), ], ), ), ), ), ), ); } }