This project demonstrates the use of Flutter's AnimatedSwitcher
widget to create a smooth transition from a splash screen to the home page of an application.
- Splash screen that displays while the application is loading.
- Animated transition from the splash screen to the home page.
- Home page that is displayed after the application has loaded.
You can customize the splash screen animation by modifying the SplashApp
class.
To get started with this project, follow these steps:
- Clone the repository:
git clone https://github.com/anzell/flutter_splash_animation_example.git
- Navigate into the project directory:
cd flutter_splash_animation_example
- Install the dependencies:
flutter pub get
- Run the application:
flutter run
The main part of this project is the SplashApp
class, which is a StatefulWidget
. In its state, an AnimationController
and an Animation
are created. The AnimationController
controls the duration of the animation, and the Animation
defines the animation's behavior.
The initState
method of the state class starts the animation when the Future method containing application's dependencies have been done. The build
method returns a Stack
widget that contains a simple splash screen containing FlutterLogo, and the home page. The home page is wrapped in an AnimatedBuilder
widget that uses the Animation
to create a scale transition from the splash screen to the home page.