Search code examples
flutterfrontendflutter-layoutsplash-screenflutter-animation

how to reduce Flutter launch_background.xml display time?


I have set an image in launch_background.xml file for splash screen. it takes around 5sec to switch to next page. how to reduce display time.

<?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>

Please suggest how to reduce display time?


Solution

  • I think you are running app in debug mode so it will take time. I will suggest you run the app in release mode. by running this command in terminal.

    flutter run --release
    

    By default, flutter run compiles to debug mode. Your IDE supports this mode. Android Studio, for example, provides a Run > Debug… menu option, as well as a green bug icon overlayed with a small triangle on the project page.

    Read more about Flutter's build modes here