import 'package:flutter/material.dart'; import 'dart:async'; import 'package:project_telephony/utils/headers.dart'; class Loading extends StatefulWidget { Loading({Key? key}) : super(key: key); @override _LoadingState createState() => _LoadingState(); } class _LoadingState extends State { @override void initState() { // TODO: implement initState super.initState(); Future.delayed(const Duration(seconds: 3),(){ //3秒后跳转到其他路由 Navigator.of(context).pushReplacementNamed("/TabNavigator"); }); } @override Widget build(BuildContext context) { //启动图片 return Scaffold( backgroundColor: Colors.white, body:Padding(padding: EdgeInsets.only(left: 148.w,top:1318.w ),child: Image.asset( Assets.images.Start.path,width:434.sp,height:148.sp , fit: BoxFit.fill),) ,); } }