forPlatform static method

FirebaseOptions forPlatform(
  1. TargetPlatform platform, {
  2. bool isWeb = false,
})

The options for platform (web when isWeb).

Implementation

static FirebaseOptions forPlatform(TargetPlatform platform, {bool isWeb = false}) {
  if (isWeb) return web;
  return switch (platform) {
    TargetPlatform.android => android,
    TargetPlatform.iOS => ios,
    TargetPlatform.macOS => macos,
    TargetPlatform.windows => windows,
    TargetPlatform.linux || TargetPlatform.fuchsia => throw UnsupportedError(
        'Firebase has no ${platform.name} support, so a project token cannot be used here. '
        'Load the project by its slug (CodelesslyConfig(slug: ...)) or from a bundle (Codelessly.asset).'),
  };
}