2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Flutter】アプリアイコンを変更する方法

Posted at

【Flutter】アプリのアイコンを変更する方法

こんにちは。
今回はFlutterのデフォルトのアイコンを変更する方法がめちゃくちゃ簡単だったので、
Qiitaに残します。

内容

デフォルトのお洒落なアイコンをこんな簡単にダサくできます。
スクリーンショット 2021-09-17 23.14.03.png

一ヶ月前くらいに試したときは専用のジェネレーター(App Icon Generator)使ってディレクトリに格納して〜
みたいな感じで意外にめんどくさいなと感じてたんですが、flutter_launcher_iconsパッケージを使えばすぐに実装できました。

まず、pubspec.yamlに記述。

pubspec.yaml
dev_dependencies:
  flutter_launcher_icons: ^0.9.2

次にアイコンにしたい画像をディレクトリに格納。
デフォルトで作成されるassetsの下にimagesを作っているのでそこに画像をペースト。
そして格納した画像を読み込みます。

pubspec.yaml
dev_dependencies:
  flutter_launcher_icons: ^0.9.2
# ↓記述
flutter_icons:
  android: true
  ios: true
  image_path: "assets/images/icon.png"

最後に

flutter pub get
flutter pub run flutter_launcher_icons:main

ビルドして終了です。

某プロスポーツ選手もFlutterを始めるみたいなので、
これから自分も負けないようにFlutterを楽しんでいきたいなと思います。

参考文献

2
5
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
2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?