1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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<SpalshPage> createState() => _SpalshPageState();
- }
- class _SpalshPageState extends State<SpalshPage> {
- @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);
- }
- }
|