| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- 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<SplashPage> createState() => _SplashPageState();
- }
- class _SplashPageState extends State<SplashPage>
- with SingleTickerProviderStateMixin {
- late final AnimationController _c;
- late final Animation<double> _fade;
- late final Animation<double> _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<SystemUiOverlayStyle>(
- 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,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ),
- );
- }
- }
|