98 lines
3.3 KiB
Dart
98 lines
3.3 KiB
Dart
// File generated for MotorSignal Firebase Configuration.
|
|
// ignore_for_file: type=lint
|
|
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
|
import 'package:flutter/foundation.dart'
|
|
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
|
|
|
import 'package:flutter/services.dart' show appFlavor;
|
|
|
|
/// Default [FirebaseOptions] for use with your Firebase apps.
|
|
class DefaultFirebaseOptions {
|
|
/// Whether the app is running in QA flavor or QA test mode.
|
|
static bool get isQa {
|
|
final flavor = appFlavor?.toLowerCase() ?? '';
|
|
if (flavor.contains('qa')) return true;
|
|
const envFlavor = String.fromEnvironment('FLAVOR');
|
|
if (envFlavor.toLowerCase().contains('qa')) return true;
|
|
const appFlavorEnv = String.fromEnvironment('APP_FLAVOR');
|
|
if (appFlavorEnv.toLowerCase().contains('qa')) return true;
|
|
return false;
|
|
}
|
|
|
|
/// Production guard ensuring QA flavor never connects to production Firebase.
|
|
static void validateFirebaseOptions(FirebaseOptions options) {
|
|
if (isQa) {
|
|
if (options.projectId == 'motoapp-d22e0' || !options.projectId.startsWith('demo-')) {
|
|
throw StateError(
|
|
'Android QA flavor cannot connect to production Firebase project (${options.projectId}). '
|
|
'QA requires a demo-* Firebase project.',
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
static FirebaseOptions get currentPlatform {
|
|
if (isQa) {
|
|
if (defaultTargetPlatform == TargetPlatform.android) {
|
|
return androidQa;
|
|
}
|
|
return qaOptions;
|
|
}
|
|
if (kIsWeb) {
|
|
return web;
|
|
}
|
|
switch (defaultTargetPlatform) {
|
|
case TargetPlatform.android:
|
|
return android;
|
|
case TargetPlatform.iOS:
|
|
return ios;
|
|
default:
|
|
return android;
|
|
}
|
|
}
|
|
|
|
static const FirebaseOptions androidQa = FirebaseOptions(
|
|
apiKey: 'demo-key',
|
|
appId: '1:123456789:android:qa',
|
|
messagingSenderId: '123456789',
|
|
projectId: 'demo-motorsignal-qa',
|
|
storageBucket: 'demo-motorsignal-qa.appspot.com',
|
|
);
|
|
|
|
static const FirebaseOptions qaOptions = FirebaseOptions(
|
|
apiKey: 'demo-key',
|
|
appId: '1:123456789:web:qa',
|
|
messagingSenderId: '123456789',
|
|
projectId: 'demo-motorsignal-qa',
|
|
storageBucket: 'demo-motorsignal-qa.appspot.com',
|
|
);
|
|
|
|
static const FirebaseOptions android = FirebaseOptions(
|
|
apiKey: 'AIzaSyD-ie8zTaAWvFUlCG5bHqRhfHKOcu4jPtg',
|
|
appId: '1:809431485362:android:06fdcd9ca12ff9342472ab',
|
|
messagingSenderId: '809431485362',
|
|
projectId: 'motoapp-d22e0',
|
|
storageBucket: 'motoapp-d22e0.firebasestorage.app',
|
|
);
|
|
|
|
static const FirebaseOptions web = FirebaseOptions(
|
|
apiKey: 'AIzaSyD-ie8zTaAWvFUlCG5bHqRhfHKOcu4jPtg',
|
|
appId: '1:809431485362:web:06fdcd9ca12ff9342472ab',
|
|
messagingSenderId: '809431485362',
|
|
projectId: 'motoapp-d22e0',
|
|
storageBucket: 'motoapp-d22e0.firebasestorage.app',
|
|
);
|
|
|
|
static const FirebaseOptions ios = FirebaseOptions(
|
|
apiKey: 'AIzaSyD-ie8zTaAWvFUlCG5bHqRhfHKOcu4jPtg',
|
|
appId: '1:809431485362:ios:06fdcd9ca12ff9342472ab',
|
|
messagingSenderId: '809431485362',
|
|
projectId: 'motoapp-d22e0',
|
|
storageBucket: 'motoapp-d22e0.firebasestorage.app',
|
|
);
|
|
|
|
/// Authoritative Web OAuth client ID for Google Sign-In on Android/Web.
|
|
static const String webClientId =
|
|
'809431485362-ar11dsgjrq7327d122b55352gs6q6sml.apps.googleusercontent.com';
|
|
}
|