0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Flutterでのモバイルアプリ開発時のIcon・Splash設定メモ

Last updated at Posted at 2025-04-01

アイコン設定

アイコンの作成

アイコンの設定

flutter_launcher_icons:
  android: true
  ios: true
  image_path: "lib/assets/launcher_icon/icon-dev.jpeg"
  adaptive_icon_background: "#01002CFF"
  adaptive_icon_foreground: "lib/assets/launcher_icon/icon-dev.jpeg"
  • lib/assets/launcher_icon配下に画像ファイルを配置する
    • ファイル名はdev環境用はicon-dev.png、prod環境用はicon.pngとする
    • 拡張子がjpgやjpegの場合は設定ファイルの記述を修正する
  • 以下のコマンドを実行することで設定が反映される
dart run flutter_launcher_icons

Splash設定

  • pubspec.yamlにflutter_native_splashを追加する
  • 公式サイトのテンプレに従ってflutter_native_splash.yamlファイルを作成する
    • flavor対応しているので、分けたい場合はsuffixに-devまたは-prodを付与する
    • colorの指定はアイコン画像の周囲に表示する色を設定する
    • 例:
flutter_native_splash:
  color: "#01002c"
  image: res/splash/icon.jpeg

  android_12:
    color: "#01002c"
    image: res/splash/icon_android12.jpeg

android: true
ios: true
web: false
  • res/splash配下にスプラッシュ画像ファイルを配置する
    • ファイル名はandroid12未満用はicon.png、android12以降用はicon_android12.png
    • 拡張子がjpgやjpegの場合は設定ファイルの記述を修正する
  • 以下のコマンドを実行することで設定が反映される
flutter pub run flutter_native_splash:create
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?