How to Add Splash Screen in Flutter App?
Last Updated :
18 Oct, 2021
We all have heard of Flutter right, it's a cross-platform application development tool. Flutter can be used to make Android, IOS, and Web applications with just one code base (Dart programming language). In this article let's see how we can add a splash screen to our applications.
What is Splash Screen?
When we open an application on our phones, the first thing we see is a screen with the logo of the app in the center that screen is referred to as a splash screen Now this splash screen can be used to make our applications look fancy but there's more to it.
When we open an app on our device, some apps are required to authenticate the user (who's opening the app) before they let us use the app. This authentication sometimes requires a fraction of a second during which time the user is presented with a splash screen so that the application does not appear to be stuck.
How to Implement it?
Flutter is all about packages, there is always a package available for our use. In this problem of ours, we will use a package called animated_splash_screen.
To install this package, add the following code to the pubspec.yaml file and run pub get :
dependencies:
animated_splash_screen: ^1.1.0
Note: Watch the indentation, if you get the indentation wrong you will get an error and we definitely don't like errors.
When we create a flutter app from scratch, we will see some boilerplate code like the one below, in the main.dart file.
Dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
// Application name
title: 'Flutter Hello World',
// Application theme data, you can set
// the colors for the application as
// you want
theme: ThemeData(
primarySwatch: Colors.blue,
),
// A widget which will be started on application startup
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatelessWidget {
final String title;
const MyHomePage({@required this.title});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// The title text which will
// be shown on the action bar
title: Text(title),
),
body: Center(
child: Text(
'Hello, World!',
),
),
);
}
}
In the above code instead of returning MyHomePage, we will return an AnimatedSplashScreen which has also required a nextScreen, where we will return our MyHomePage. Like this:
Dart
import 'package:flutter/material.dart';
import 'package:animated_splash_screen/animated_splash_screen.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
// Application name
title: 'GFG tutotial',
// Application theme data, you can set the
// colors for the application as
// you want
theme: ThemeData(
primarySwatch: Colors.green,
),
// A widget which will be started on application startup
home: AnimatedSplashScreen(
splash: 'images/gfg.png',
nextScreen: MyHomePage(title: 'GeeksForGeeks'),
splashTransition: SplashTransition.fadeTransition,
),
);
}
}
class MyHomePage extends StatelessWidget {
final String title;
const MyHomePage({@required this.title});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// The title text which will be shown on the action bar
title: Text(title),
),
body: Center(
child: Text(
'GeeksForGeeks!',
),
),
);
}
}
To use our own image for the splash screen we have to include the images under the assets section in pubspec.yaml file :
Output :

Similar Reads
Flutter Tutorial This Flutter Tutorial is specifically designed for beginners and experienced professionals. It covers both the basics and advanced concepts of the Flutter framework.Flutter is Googleâs mobile SDK that builds native Android and iOS apps from a single codebase. It was developed in December 2017. When
7 min read
Types of Internet Protocols Internet protocols are a set of rules that allow computers and other devices to communicate over the Internet. These protocols ensure that data is sent, received, and understood correctly between different systems. There are many types of internet protocols, each serving a specific purpose, such as
12 min read
Data Communication - Definition, Components, Types, Channels Transferring data over a transmission medium between two or more devices, systems, or places is known as data communication. Nowadays, computing and telecommunications depend heavily on this data transmission, which makes a variety of applications conceivable, including email, video chatting, the In
7 min read
Types of Network Firewall Network Firewalls are the devices that are used to prevent private networks from unauthorized access. A Firewall is a security solution for the computers or devices that are connected to a network, they can be either in the form of hardware as well as in form of software. It monitors and controls th
7 min read
How to Install ReactJS on Windows: Step-by-Step Guide ReactJS has become one of the most popular JavaScript libraries for building dynamic and interactive user interfaces, powering some of the biggest websites and applications across the web. If you're a Windows user eager to dive into React development, setting up your environment properly is the firs
8 min read
Top 50 Flutter Interview Questions and Answers for 2025 Flutter is an open-source, cross-platform application development framework. It was developed by Google in 2017. It is used to build applications for Android, iOS, Linux, Mac, Windows, and the web. Flutter uses the Dart programming language. It provides a simple, powerful, efficient, and easy-to-und
15+ min read
Life Cycle of Java Applet An applet is a Java program that can be embedded into a web page. It runs inside the web browser and works on the client side. An applet is embedded in an HTML page using the APPLET or OBJECT tag and hosted on a web server. The Applet Container manages the entire life cycle of an applet. All applets
7 min read
Middleware in Express Middleware in Express refers to functions that process requests before reaching the route handlers. These functions can modify the request and response objects, end the request-response cycle, or call the next middleware function. Middleware functions are executed in the order they are defined. They
6 min read
What is Widgets in Flutter? Flutter is Google's UI toolkit for crafting beautiful, natively compiled iOS and Android apps from a single code base. To build any application we start with widgets - The building block of Flutter applications. Widgets describe what their view should look like given their current configuration and
5 min read
Flutter | An introduction to the open source SDK by Google Flutter is Googleâs Mobile SDK to build native iOS and Android, Desktop (Windows, Linux, macOS), and Web apps from a single codebase. When building applications with Flutter, everything is Widgets â the blocks with which the flutter apps are built. They are structural elements that ship with a bunch
5 min read