Adding SplashScreen in Flutter Application
When you press the application icon on the mobile phone, it takes a while until the application is opened. The size of this application can be between 1–5 seconds or more depending on the processor power it uses. Between pressing the application icon and the opening screen of the application, the response time can be shortened by putting a picture logo on the screen at this stage to prevent the user from having hesitation about whether the application is running or whether the phone is detected by pressing the icon and to provide a better user experience. You can do this in two ways. In this article, SplashScreen will be added by making the necessary edits in the launch_background.xml file.
The other method we can do using the Splash Screen package. Thanks to this package, splahscreen duration, background color, text color size etc. can be done in the settings.
The opening screen called launch_image.png png format we want to show pictures of <projeklasör of> / android / app / src / main / res / drawable / (C: \ Users \ mzkarakas \ androidstudioprojects \ flutter_app_sit to \ android \ app \ src \ main \ res \ drawable ) file to add
Let’s open the file “launch_background.xml” in the folder <ProjectFolder>/android/app/src/main/res/drawable/ (C:\Users\mzkarakas\AndroidStudioProjects\flutter_app_site\android\app\src\main\res\drawable) .
Let’s write the path of the picture we uploaded by activating the codes that are in the form of comments. The final version of the code will be as follows.
Now, the picture we added while opening the application will appear on the screen, when the application is opened, it will disappear from the screen and go to the main screen of the application.
Son yorumlar