How to add or remove Flutter Native Splash 2022

Flutter Login App, Flutter UI / UX, UI UX

In this flutter native splash example tutorial, we will learn how to create or add Flutter Native Splash 2022. To add a Flutter native splash we have to use a pub.dev package called flutter_native_splash and it can be removed with a remove keyword.

Prerequisite

This is the 4th tutorial of our Flutter Login App Series.

Watch the previous tutorial about how to use themes in a flutter.

Flutter Native Splash Screen

When app runs, white or black screen appears at the start is called Native Splash Screen.

To customize that native splash screen, we have 2 ways. Do it manually or add a plugin called flutter_native_splash.

We are going to setup this package for native splash. Using this package logo and a branding image can be added. There is also an option to add light and dark native splash screen.

How to create Flutter Native Splash Screen

To add a package Run these Commands in Flutter Terminal.

  • flutter clean
  • flutter pub get
  • flutter pub add flutter_native_splash
flutter clean
flutter pub get
flutter pub add flutter_native_splash

Setup & Design Flutter Native Splash

We have to add all the code in the pubspec.yaml file because we have to make changes in the root directories of Android and IOS. Therefore, we cannot make changes in the system using dart files.

First, add flutter_native_splash as a dependency in your pubspec.yaml file.

dependencies:
  flutter_native_splash: ^2.2.8

Don’t forget to flutter pub get.

Customize the following settings and add to your project’s pubspec.yaml file or place in a new file in your root project folder named flutter_native_splash.yaml.

# flutter_native_splash-development.yaml
flutter_native_splash:
  color: "#ffffff"
  image: assets/logo-development.png
  branding: assets/branding-development.png
  color_dark: "#121212"
  image_dark: assets/logo-development.png
  branding_dark: assets/branding-development.png

  android_12:
    image: assets/logo-development.png
    icon_background_color: "#ffffff"
    image_dark: assets/logo-development.png
    icon_background_color_dark: "#121212"

  web: false

# flutter_native_splash-acceptance.yaml
flutter_native_splash:
  color: "#ffffff"
  image: assets/logo-acceptance.png
  branding: assets/branding-acceptance.png
  color_dark: "#121212"
  image_dark: assets/logo-acceptance.png
  branding_dark: assets/branding-acceptance.png

  android_12:
    image: assets/logo-acceptance.png
    icon_background_color: "#ffffff"
    image_dark: assets/logo-acceptance.png
    icon_background_color_dark: "#121212"

  web: false

# flutter_native_splash-production.yaml
flutter_native_splash:
  color: "#ffffff"
  image: assets/logo-production.png
  branding: assets/branding-production.png
  color_dark: "#121212"
  image_dark: assets/logo-production.png
  branding_dark: assets/branding-production.png

  android_12:
    image: assets/logo-production.png
    icon_background_color: "#ffffff"
    image_dark: assets/logo-production.png
    icon_background_color_dark: "#121212"

  web: false

After adding your settings, run the following command in the terminal:

flutter pub run flutter_native_splash:create

When the package finishes running, your splash screen is ready.

To specify the YAML file location just add –path with the command in the terminal:

flutter pub run flutter_native_splash:create --path=path/to/my/file.yaml

How to remove Flutter Native Splash

To remove a flutter native splash, just make sure that all the code that created for this flutter_native_splash is not removed.

Run the Command to remove flutter native splash, afterwards remove the code and package from the system.

Commands are as follows:-

  • flutter pub run flutter_native_splash:remove
  • flutter clean
  • flutter pub get
flutter clean
flutter pub get
flutter pub add flutter_native_splash

Let's Connect

Videos are always a better source for in-depth knowledge. So, connect with me at YouTube.

Download Project

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Latest Courses

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Learn flutter from scratch in 4 hours - Flutter Crash Course - Coding with T

Latest Tutorials

Flutter Profile page UI Design - Flutter app design 2023 - Profile Screen Flutter UI - Flutter 2023
Flutter Firebase phone authentication - Firebase Phone auth tutorial in flutter - Flutter Firebase phone number authentication 2022
Firebase Authentication in flutter - Flutter firebase authentication 2022 - firebase auth tutorial 2022 - firebase flutter auth
How to setup firebase in flutter 2022 - Flutter firebase setup
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Join Our Mailing List

Join our mailing list to receive the latest, Free Courses, Video Tutorials, free codes and updates regarding Tutorials and services. You will also start getting coupons on the related services.

You have Successfully Subscribed!

FLUTTER APP

Learn Flutter App development from scratch. Create LOGIN APP that can be used with any application which requires Login Sign Up functionality.

You can watch it on YouTube or read and get source code from Blog Post.

You have Successfully Subscribed!