FlutterでLaunchScreen SplashScreenを実装する

FlutterでiOSのLaunchScreen、AndroidのSplashScreenを実装

下記のパッケージを利用します

https://pub.dev/packages/flutter_native_splash

インストール

dependencies:
  flutter_native_splash: ^2.0.1+1

実装

pubspec.yamlに下記の項目を追加する

flutter_native_splash:
  image: "assets/splash.png"
  color: "000000" #color

imageにはスプラッシュに利用する画像のパス

colorは背景に利用されます

設定が終わったあとは

flutter pub run flutter_native_splash:create

でスプラッシュスクリーンを作成します

以上でスプラッシュスクリーンの作成完了です。