Don’t say complex, just talk about the problems you may encounter my writing and expression level is ordinary, so may typo or write wrong, please forgive me

Flutter is a mobile cross-platform UI framework. One piece of code can be used equally on both Android and iOS. However, there are some changes to the iOS and Android code to implement Flutter, such as the launch image we will talk about today!

Flutter does not have a startup image by default, so the screen that appears when the App is opened will be a blank screen. A good App must have a startup image.

Currently, the majority of Developers using Flutter are iOS or Android developers, either Android or iOS, and may be a little confused when it comes to modifying the startup image. In this article, I will teach you the simplest way to add a launch image to your App. I believe it will help you!

For a complete example, see GitHub: Flutter Taobao App

First, iOS startup map setting

1. Add a startup diagram

First of all, open the project and find the file assets. xcassets. Open the file and click + and then click New Image Set to name the Image and add @2x and @3x images respectively

@1x images are not needed, only on the iPhone 3GS

2. Set the startup diagram

Xcode has given us launscreen.storyboard by default, and from this file we can modify the startup diagram. So, run it again, and you’ll notice that the startup screen is no longer blank.

Note that the Content Mode of the image should be changed To Scale To Fill

Second, Android startup map Settings

1. Add a startup diagram

Open the res directory (android/app/ SRC /main/res) and add your images in turn to the Mipmap directory

Images can all be the same size

Setting up the startup diagram

Open the drawable directory in res, open the launch_background. XML file, and add the following code

<item Android :drawable= <item android:drawable="@mipmap/launch_image"></item>
Copy the code