LoginSignup
0
0

Flutter で Android や iOS のアプリアイコンを一括で変更したい!

Posted at

これなに

クロスプラットフォームなんだから Manifest だったり Assets.xcassets だったりと個別に設定やらないでアプリアイコンを一発で設定くらいできるでしょう。
そんな思いから何かないかなあと思って調べてみました。

設定手順

1. flutter_launcher_icons package を pubspec.yaml に追加

以下をターミナルで実行して追加する

$ flutter pub add flutter_launcher_icons

2. 任意の場所にアイコンファイルを追加

基本的にはプロジェクト配下に assets フォルダを作成して、その中で設定しておくのが良さそう
image.png

3. pubspec.yaml でアイコンファイルのパスを通す

どこに書いても大丈夫だけど、僕は flutter: セクションの直前くらいに書いておいた

flutter_launcher_icons:
  android: true
  ios: true
  remove_alpha_ios: true
  image_path: "assets/icons/application_icon.png"

4. アイコン適用コマンドをターミナルで実行

これを実行したのち、ビルドしてみるとアイコンが適用できていました。

$ flutter pub run flutter_launcher_icons

おわりに

上記の手順については全てこの公式ページに書いてありました、素晴らしい!
https://pub.dev/packages/flutter_launcher_icons
image.png

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