currentPlatform property

FirebaseOptions currentPlatform

Implementation

static FirebaseOptions get currentPlatform {
  final flavor = FlavorConfig.config.flavor;

  if (kIsWeb) {
    throw UnsupportedError(
      'DefaultFirebaseOptions have not been configured for web - '
      'you can reconfigure this by running the FlutterFire CLI again.',
    );
  }
  switch (defaultTargetPlatform) {
    case TargetPlatform.android:
      return switch (flavor) {
        Flavor.development => androidDev,
        Flavor.staging => androidStag,
        _ => android,
      };
    case TargetPlatform.iOS:
      return switch (flavor) {
        Flavor.development => iosDev,
        Flavor.staging => iosStag,
        _ => ios,
      };
    default:
      throw UnsupportedError(
        'DefaultFirebaseOptions have not been configured for macos - '
        'you can reconfigure this by running the FlutterFire CLI again.',
      );
  }
}