[Flutter]アプリアイコンを変更する
広告Flutter
2024年01月14日
アプリのアイコンは iOS と Android 用のイメージを生成して、各プラットフォームにアプリのアイコンを設定する必要がありますが flutter_launcher_iconsパッケージを利用することで一括で変更することができます。
#1.flutter_launcher_icons をインストール
flutter_launcher_icons | Dart package
A package which simplifies the task of updating your Flutter app's launcher icon.flutter pub add -d flutter_launcher_iconsdev_dependencies:
flutter_launcher_icons: ^0.13.1#2.設定
pubspec.yaml に画像パスを設定します。
dev_dependencies:
flutter_launcher_icons: "^0.13.1"
flutter_launcher_icons:
android: true
ios: true
image_path: "assets/icon.png"
remove_alpha_ios: trueimage_path は任意の画像配置パスを指定します。
#3.コマンドを実行
アイコン画像を生成します。
flutter pub run flutter_launcher_icons