123456789101112131415161718192021222324252627282930 |
- 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<SplashPage> {
- @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);
- });
- }
- }
|