checkSupportedPlatform static method
void
checkSupportedPlatform(})
Implementation
static void checkSupportedPlatform(
String libName, {
required bool ios,
required bool android,
required bool macos,
required bool windows,
required bool linux,
required bool web,
}) {
if (web) return;
final targets = <String>[
if (ios) 'iOS',
if (android) 'Android',
if (macos) 'macOS',
if (windows) 'Windows',
if (linux) 'Linux',
].join(', ');
throw UnsupportedError(
'$libName: this generated Nitro module does not target Web. Targeted '
'platforms: ${targets.isEmpty ? 'none' : targets}. Add '
'`web: NativeImpl.wasm` to @NitroModule, regenerate with '
'`nitrogen generate`, run `nitrogen link`, and rebuild the app.',
);
}