import 'package:flutter/material.dart'; import 'package:gobang/pages/splash/countdown.dart'; import 'package:gobang/routes.dart'; /// Description: splash page /// 加载缓存ad pic,倒计时3秒,if login go index else go login page /// Time : 02/20/2024 Tuesday /// Author : liuyuqi.gov@msn.cn class SpalshPage extends StatefulWidget { const SpalshPage({Key? key}) : super(key: key); @override State createState() => _SpalshPageState(); } class _SpalshPageState extends State { @override Widget build(BuildContext context) { return Scaffold( body: Stack(children: [ Positioned.fill( child: Image.asset( "assets/images/splash.jpg", cacheWidth: 750, fit: BoxFit.cover, )), Positioned( right: 30, top: 30, child: Countdown(), ) ]), ); } @override void dispose() { super.dispose(); } @override void didChangeDependencies() { super.didChangeDependencies(); goMain(); } void goMain() async { Routes.popAndPushNamed(context, Routes.index); } }