android应用程序自己本身会带有一定时间的启动页面白屏,在flutter上貌似就更长时间的白屏了,分享一下如何解决:
首先我们看到官方文档有类似的相关介绍,其实官方给我们也提供了一定程度上的解决办法:
iOS:
将此处的图片换为我们自己的图片即可。
android:
找到对应位置处,红框中为我们自己新添加的背景图片,在xml文件中修改图中标识处的引用即可,在许多机型中,有的加载很快,有的加载会很慢,很多时候会看见闪屏现象,那我们在flutter启动过程中肯定是想要加载我们另外的过渡背景,这里我简单举个栗子:
class Splash extends StatefulWidget {
const Splash({Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() => _SplashState();
}
class _SplashState extends State<Splash> {
late Timer _timer;
@override
void initState() {
super.initState();
init();
}
void init() async {
///延迟跳转 -- Delayed jump
_timer = Timer(const Duration(milliseconds: 150