154 lines
5.4 KiB
Dart
154 lines
5.4 KiB
Dart
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
|
import 'package:flutter/foundation.dart'
|
|
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
|
import 'package:krow_core/core.dart';
|
|
|
|
/// Environment-aware [FirebaseOptions] for the Staff app.
|
|
///
|
|
/// Selects the correct Firebase configuration based on the compile-time
|
|
/// `ENV` dart define (dev, stage, prod). Defaults to dev.
|
|
class DefaultFirebaseOptions {
|
|
static FirebaseOptions get currentPlatform {
|
|
if (kIsWeb) {
|
|
return _webOptions;
|
|
}
|
|
switch (defaultTargetPlatform) {
|
|
case TargetPlatform.android:
|
|
return _androidOptions;
|
|
case TargetPlatform.iOS:
|
|
return _iosOptions;
|
|
default:
|
|
throw UnsupportedError(
|
|
'DefaultFirebaseOptions are not supported for this platform.',
|
|
);
|
|
}
|
|
}
|
|
|
|
static FirebaseOptions get _androidOptions {
|
|
switch (AppEnvironment.current) {
|
|
case AppEnvironment.dev:
|
|
return _devAndroid;
|
|
case AppEnvironment.stage:
|
|
return _stageAndroid;
|
|
case AppEnvironment.prod:
|
|
return _prodAndroid;
|
|
}
|
|
}
|
|
|
|
static FirebaseOptions get _iosOptions {
|
|
switch (AppEnvironment.current) {
|
|
case AppEnvironment.dev:
|
|
return _devIos;
|
|
case AppEnvironment.stage:
|
|
return _stageIos;
|
|
case AppEnvironment.prod:
|
|
return _prodIos;
|
|
}
|
|
}
|
|
|
|
static FirebaseOptions get _webOptions {
|
|
switch (AppEnvironment.current) {
|
|
case AppEnvironment.dev:
|
|
return _devWeb;
|
|
case AppEnvironment.stage:
|
|
return _stageWeb;
|
|
case AppEnvironment.prod:
|
|
return _prodWeb;
|
|
}
|
|
}
|
|
|
|
// ===========================================================================
|
|
// DEV (krow-workforce-dev)
|
|
// ===========================================================================
|
|
|
|
static const FirebaseOptions _devAndroid = FirebaseOptions(
|
|
apiKey: 'AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4',
|
|
appId: '1:933560802882:android:ee100eab75b6b04c7757db',
|
|
messagingSenderId: '933560802882',
|
|
projectId: 'krow-workforce-dev',
|
|
storageBucket: 'krow-workforce-dev.firebasestorage.app',
|
|
);
|
|
|
|
static const FirebaseOptions _devIos = FirebaseOptions(
|
|
apiKey: 'AIzaSyDyEXkzZAWpXXe4dAesYaZflt5BEtMn9tA',
|
|
appId: '1:933560802882:ios:edf97dab6eb87b977757db',
|
|
messagingSenderId: '933560802882',
|
|
projectId: 'krow-workforce-dev',
|
|
storageBucket: 'krow-workforce-dev.firebasestorage.app',
|
|
androidClientId:
|
|
'933560802882-fbqg2icq24bmci3f84evjrbth5huh87f.apps.googleusercontent.com',
|
|
iosClientId:
|
|
'933560802882-fphpkdjubve8k7e8ogqj3fk1qducv3sg.apps.googleusercontent.com',
|
|
iosBundleId: 'dev.krowwithus.staff',
|
|
);
|
|
|
|
static const FirebaseOptions _devWeb = FirebaseOptions(
|
|
apiKey: 'AIzaSyBqRtZPMGU-Sz5x5UnRrunKu5NSWYyPRn8',
|
|
appId: '1:933560802882:web:173a841992885bb27757db',
|
|
messagingSenderId: '933560802882',
|
|
projectId: 'krow-workforce-dev',
|
|
authDomain: 'krow-workforce-dev.firebaseapp.com',
|
|
storageBucket: 'krow-workforce-dev.firebasestorage.app',
|
|
measurementId: 'G-9S7WEQTDKX',
|
|
);
|
|
|
|
// ===========================================================================
|
|
// STAGE (krow-workforce-staging)
|
|
// ===========================================================================
|
|
|
|
static const FirebaseOptions _stageAndroid = FirebaseOptions(
|
|
apiKey: 'AIzaSyCgTXI3QhbEK3r4J5y7ek_6AxqhmR99QjY',
|
|
appId: '1:1032971403708:android:14e471d055e59597356bb9',
|
|
messagingSenderId: '1032971403708',
|
|
projectId: 'krow-workforce-staging',
|
|
storageBucket: 'krow-workforce-staging.firebasestorage.app',
|
|
);
|
|
|
|
static const FirebaseOptions _stageIos = FirebaseOptions(
|
|
apiKey: 'AIzaSyCgTXI3QhbEK3r4J5y7ek_6AxqhmR99QjY',
|
|
appId: '1:1032971403708:ios:8c2bbd76bc4f55d9356bb9',
|
|
messagingSenderId: '1032971403708',
|
|
projectId: 'krow-workforce-staging',
|
|
storageBucket: 'krow-workforce-staging.firebasestorage.app',
|
|
iosBundleId: 'stage.krowwithus.staff',
|
|
);
|
|
|
|
static const FirebaseOptions _stageWeb = FirebaseOptions(
|
|
apiKey: 'AIzaSyCgTXI3QhbEK3r4J5y7ek_6AxqhmR99QjY',
|
|
appId: '', // TODO: Register web app in krow-workforce-staging
|
|
messagingSenderId: '1032971403708',
|
|
projectId: 'krow-workforce-staging',
|
|
storageBucket: 'krow-workforce-staging.firebasestorage.app',
|
|
);
|
|
|
|
// ===========================================================================
|
|
// PROD (krow-workforce-prod)
|
|
// TODO: Fill in after creating krow-workforce-prod Firebase project
|
|
// ===========================================================================
|
|
|
|
static const FirebaseOptions _prodAndroid = FirebaseOptions(
|
|
apiKey: '', // TODO: Add prod API key
|
|
appId: '', // TODO: Add prod app ID
|
|
messagingSenderId: '', // TODO: Add prod sender ID
|
|
projectId: 'krow-workforce-prod',
|
|
storageBucket: 'krow-workforce-prod.firebasestorage.app',
|
|
);
|
|
|
|
static const FirebaseOptions _prodIos = FirebaseOptions(
|
|
apiKey: '', // TODO: Add prod API key
|
|
appId: '', // TODO: Add prod app ID
|
|
messagingSenderId: '', // TODO: Add prod sender ID
|
|
projectId: 'krow-workforce-prod',
|
|
storageBucket: 'krow-workforce-prod.firebasestorage.app',
|
|
iosBundleId: 'prod.krowwithus.staff',
|
|
);
|
|
|
|
static const FirebaseOptions _prodWeb = FirebaseOptions(
|
|
apiKey: '', // TODO: Add prod API key
|
|
appId: '', // TODO: Add prod app ID
|
|
messagingSenderId: '', // TODO: Add prod sender ID
|
|
projectId: 'krow-workforce-prod',
|
|
storageBucket: 'krow-workforce-prod.firebasestorage.app',
|
|
);
|
|
}
|