如何减少Flutter的launch_background.xml显示时间?

问题描述 投票:0回答:1

我已经在launch_background.xml文件中为初始屏幕设置了图像。切换到下一页大约需要5秒。如何减少显示时间。

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
  <!--   <item android:drawable="@android:color/white" />-->

    <!-- You can insert your own image assets here -->
  <item>
        <bitmap
            android:gravity="center"
            android:src="@mipmap/splash_screen" />
    </item> 
</layer-list>

请建议如何减少显示时间?

flutter frontend flutter-layout splash-screen flutter-animation
1个回答
0
投票

我认为您正在以调试模式运行应用程序,因此这需要时间。我建议您在发布模式下运行该应用程序。通过在终端中运行此命令。

flutter run --release

默认情况下,flutter运行会编译为调试模式。您的IDE支持此模式。例如,Android Studio提供了“运行”>“调试”菜单选项,以及在项目页面上带有小三角形的绿色错误图标。

阅读有关Flutter's build modes here的更多信息

© www.soinside.com 2019 - 2024. All rights reserved.