Search code examples
flutterflutter-windows

how to change desktop windows application icon for flutter?


I used the desktop flutter and I searched for a way to do that I couldn't find any articles about that, so I want to know how to change the launcher app icon for Windows desktop and also for Mac and Linux.

[UPDATE] Now flutter_launcher_icons package supports all platforms

To set it up:

  1. Create a file and may name it as flutter_launcher_icons.yaml
  2. Add configuration to flutter_launcher_icons.yaml
  3. Specify image paths and platforms
dev_dependencies:
  flutter_launcher_icons: "^0.13.1"

flutter_launcher_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/icon/icon.png"
  min_sdk_android: 21 # android min sdk min:16, default 21
  web:
    generate: true
    image_path: "path/to/image.png"
    background_color: "#hexcode"
    theme_color: "#hexcode"
  windows:
    generate: true
    image_path: "path/to/image.png"
    icon_size: 48 # min:48, max:256, default: 48
  macos:
    generate: true
    image_path: "path/to/image.png"
  1. Run pub get and the package
flutter pub get
flutter pub run flutter_launcher_icons -f flutter_launcher_icons.yaml

Solution

  • To change the icon you just need to replace the icon file in your project:

    • Windows: windows/runner/resources/app_icon.ico
    • macOS: macos/Runner/Assets.xcassets/AppIcon.appiconset

    Linux doesn't have an icon set up in the template yet; you can follow this issue for updates.