import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; import 'package:gobang/themes/app_colors.dart'; import 'package:gobang/routes/app_routes.dart'; class SplashPage extends StatefulWidget { const SplashPage({super.key}); @override State createState() => _SplashPageState(); } class _SplashPageState extends State with SingleTickerProviderStateMixin { late final AnimationController _c; late final Animation _fade; late final Animation _scale; @override void initState() { super.initState(); _c = AnimationController( vsync: this, duration: const Duration(milliseconds: 900), ); _fade = CurvedAnimation(parent: _c, curve: Curves.easeOut); _scale = Tween(begin: 0.86, end: 1.0).animate( CurvedAnimation(parent: _c, curve: Curves.easeOutBack), ); _c.forward(); Future.delayed(const Duration(milliseconds: 1400), () { if (mounted) Get.offNamed(AppRoutes.home); }); } @override void dispose() { _c.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return AnnotatedRegion( value: SystemUiOverlayStyle.light, child: Scaffold( body: Container( width: double.infinity, decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ Color(0xFF0A2F28), AppColors.ink, AppColors.pumpkin, ], stops: [0, 0.55, 1], ), ), child: FadeTransition( opacity: _fade, child: ScaleTransition( scale: _scale, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Container( width: 108, height: 108, decoration: BoxDecoration( shape: BoxShape.circle, gradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [AppColors.pumpkinSoft, AppColors.pumpkin], ), boxShadow: [ BoxShadow( color: Colors.black.withValues(alpha: 0.35), blurRadius: 28, offset: const Offset(0, 12), ), ], ), ), const SizedBox(height: 28), const Text( '南瓜五子棋', style: TextStyle( color: AppColors.ivory, fontSize: 34, fontWeight: FontWeight.w800, letterSpacing: 1.2, ), ), const SizedBox(height: 10), Text( '对决决策树 · 落子有声', style: TextStyle( color: AppColors.ivory.withValues(alpha: 0.72), fontSize: 14, ), ), ], ), ), ), ), ), ); } }