21
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

Flutterにおけるアプリアイコンの変更

Flutterにおけるアプリアイコンの変更方法

https://pub.dartlang.org/packages/flutter_launcher_icons
このライブラリを使うとぱぱっと変更できます。

pubspec.yml
dev_dependencies: 
  flutter_test:
    sdk: flutter

  flutter_launcher_icons: any

とりあえずFlutterプロジェクトのpubspec.ymlにflutter_launcher_iconsを追加します。
$ flutter packages get

それから、同じくpubspec.ymlにアイコンのパスと、それぞれのOSでアプリアイコン指定のものに変更するかを定義します。

pubspec.yml
flutter_icons:
  android: true 
  ios: true
  image_path: "assets/icon/icon.png"

アイコンを作り、指定したパスに配置し、最後の仕上げで以下のコマンドでアプリアイコンを生成します。
$ flutter pub pub run flutter_launcher_icons:main

まとめ

めっちゃ楽

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
21
Help us understand the problem. What are the problem?