icon property
The picture the window and the Dock show for this repository, relative
to package's root — 'logo.png', 'assets/brand/mark.png',
'macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png'.
Named rather than found, which is what this field is for. The
first version of this searched the declared package's platform directories
for its best launcher icon, skipping any file whose bytes matched a
flutter create default. It picked the Flutter logo for a real mobile app
— one whose generator writes iOS and Android icons and leaves macos/
alone — because the macOS icon there was the template's, written by an
older Flutter than the one the hashes were taken from. A byte-exact list
of upstream template files goes stale on upstream's schedule, and it goes
stale silently — a window wearing the wrong face with nothing on screen to
explain it.
Naming the file cannot expire. It also lets a project point at the art it actually thinks of as its logo — the source image its icon generator reads — rather than at whichever generated platform variant happened to rank highest.
Anything Flutter can decode works; a .ico does not, and neither does a
path that is not there. Both are reported against the worktree rather than
passed over: a declaration that went nowhere is a mistake, and naming the
file is what makes it possible to point at.
Implementation
final String icon;