I've a flutter desktop linux app and I want to set icon app so when I build the app by typing this command flutter build linux
the executable file got this icon and this icon appears at the taskbar.
At this moment the executable file has set a generic icon and when the app is running then the taskbar shows an empty icon.
I've read the answer on https://stackoverflow.com/a/73134323/9301998 but this only shows the icon on the taskbar if I run the app typing the command flutter run -d linux
but when I build the app by typing this command flutter build linux
it's not assign the icon that I want.
The image that I want to set as icon I've added as assets in the pubspec.yaml
file.
Then I've created a my_app.desktop
file with:
[Desktop Entry]
Version=1.0
Type=Application
Name=my_app
Exec=/home/pepe/my_app/build/linux/x64/release/bundle/my_app
Icon=/home/pepe/my_app/build/linux/x64/release/bundle/data/flutter_assets/assets/images/logo.ico
Comment=Welcome to the flutterverse!
Categories=Development;
Terminal=false
StartupNotify=true;
Then I can see the icon on the desktop, I still add the app as favorite to the taskbar, but when I click on the icon to run the app it runs but it continues adding an empty icon in the taskbar.
This article explains How to change icon of linux desktop app but it's through snapstore and I would like to do this when I build the app by typing this command flutter build linux
directly.