Splash Screen

Using the package

environment:
  sdk: ">=2.1.0 <3.0.0"

Add dependency in pubspec.yaml

dependencies:
  animated_splash: ^0.0.1

Things to do

  1. Get a logo for your app
  2. Prepare what to execute while the splash screen is shown (initializing your db, shared preferences, firebase...etc)
  3. Screen to be shown after splash screen
  4. Duration of Splash Screen

Import the package

import 'package:animated_splash/animated_splash.dart';

Create an object of Function that gets executed while splash screen is shown

Function duringSplash = () {
  //Write your code here
  ...
};

Inside your main function, use home as SplashScreen(_), the parameters are as follows:

imagePath: Path to your app-logo/image home: Screen to be shown after splash duringSplash: the function you have written above duration: duration of splash screen in milliseconds

runApp(MaterialApp(
  home: SplashScreen(
      imagePath: 'your_logo_path',
      home: YourHomeScreen(),
      duringSplash: duringSplash,
      duration: 2500),
));

Demo

ProgressDialog Demo

Libraries

animated_splash