shortcutsFor method
Returns the command shortcuts resolved for one target platform.
Implementation
List<ShortcutActivator> shortcutsFor(TargetPlatform platform) {
final selected = switch (platform) {
TargetPlatform.macOS => macOSShortcuts ?? shortcuts,
TargetPlatform.windows => windowsShortcuts ?? shortcuts,
TargetPlatform.linux => linuxShortcuts ?? shortcuts,
TargetPlatform.iOS => iOSShortcuts ?? macOSShortcuts ?? shortcuts,
TargetPlatform.android => androidShortcuts ?? shortcuts,
TargetPlatform.fuchsia => fuchsiaShortcuts ?? shortcuts,
};
if (platform != TargetPlatform.macOS && platform != TargetPlatform.iOS) {
return selected;
}
return selected.map(_macOSActivator).toList(growable: false);
}