import 'package:douyin_demo/routes.dart'; import 'package:flutter/material.dart'; class SplashPage extends StatefulWidget { const SplashPage({Key? key}) : super(key: key); @override _SplashPageState createState() => _SplashPageState(); } class _SplashPageState extends State { @override Widget build(BuildContext context) { return Scaffold( body: Text("闪屏页"), ); } @override void didChangeDependencies() { super.didChangeDependencies(); goMain(); } void goMain() { Future.delayed(Duration(seconds: 1), () { Routes.popAndPushNamed(context, Routes.home); }); } }