In this blog we will implement that how to Remove white screen at the start of flutter.
We know that we add the splash screen as first screen in our application.In flutter, there is a white screen for few microseconds.After that white screen we have the splash screen.
this white screen gives a negative impact for our application.In this blog we’ll remove the white screen.
For implement this we will use a flutter plugin.
Check out more about our Flutter app development company.
Before wasting time, let’s begin the stepwise code implementation.
Step1:-Add the flutter Plugin.
First of all, let’s add the flutter plugin i.e.flutter_native_splash.It automatically generates native code for adding splash screens in Android and iOS. Customise with specific platform, background colour and splash image.
1 2 3 4 |
dev_dependencies: flutter_test: sdk: flutter flutter_native_splash: |
Step2:-Initialise flutter_native_splash in pubspec.yaml file
1 2 |
flutter_native_splash: color: "#42a5f5" |
Step3:-Customise the settings
Customise the following settings and add to a new file in your root project folder named flutter_native_splash.yaml.
1 2 3 4 5 6 7 8 9 10 11 12 |
flutter_native_splash: color: "#42a5f5" android: false ios: false android_gravity: center android_fullscreen: true |
Step4:-Run the Package and check the output
After adding your settings,run the following command at you terminal.
1 |
flutter pub run flutter_native_splash:create |
When the package finishes running your splash screen is ready.
As you can see there’s no white screen in the starting of application.
Congratulations!!!! you have learned that how to Remove white screen at the start of flutter.
For more details and methods you can refer to the official doc of flutter here.
For more interesting blogs check out here – https://mobikul.com/blog/
Hope this blog helped you with a better understanding that how to Remove white screen at the start of flutter
Thanks for reading.