flavorByPlatform property
flavor, where it depends on the platform the launch targets.
The case is real: an app split into two store identities builds the same
entry point under kioskLocal on a phone — where the flavor decides
the package id and the deep links, and the wrong one installs over the
other app — and under plain local on a desktop, where none of that
exists. One declaration:
Entrypoint('lib/main_kiosk.dart', name: 'Kiosk',
flavor: 'local',
flavorByPlatform: {RunPlatform.mobile: 'kioskLocal'}),
The launch resolves against the target device's platform: a concrete key
(RunPlatform.ios) beats a shorthand (RunPlatform.mobile), a shorthand
beats flavor, and a platform in neither falls back to flavor and then
to the pubspec's default-flavor: as always. The two shorthands cannot
overlap each other, so there is no ambiguity to refuse. The launch
action's flavor argument still beats all of it.
Before this field the answer was two declarations of the same path with the platform spelled twice — once in each name, once in platforms — and a picker showing two rows for one thing.
Implementation
final Map<RunPlatform, String> flavorByPlatform;