mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 18:04:54 +00:00
firebase prod setup and flavors enhancement.
This commit is contained in:
41
lib/firebase_options.dart
Normal file
41
lib/firebase_options.dart
Normal file
@ -0,0 +1,41 @@
|
||||
// File generated by FlutterFire CLI.
|
||||
// ignore_for_file: type=lint
|
||||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:syncrow_app/firebase_options_dev.dart' as dev;
|
||||
import 'package:syncrow_app/firebase_options_prod.dart' as prod;
|
||||
import 'package:syncrow_app/firebase_options_staging.dart' as staging;
|
||||
|
||||
/// Default [FirebaseOptions] for use with your Firebase apps.
|
||||
///
|
||||
/// Example:
|
||||
/// ```dart
|
||||
/// import 'firebase_options.dart';
|
||||
/// // ...
|
||||
/// await Firebase.initializeApp(
|
||||
/// options: DefaultFirebaseOptions.currentPlatform,
|
||||
/// );
|
||||
/// ```
|
||||
class DefaultFirebaseOptions {
|
||||
static FirebaseOptions get currentPlatform {
|
||||
const flavor = String.fromEnvironment('flavor');
|
||||
if (kIsWeb) {
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions have not been configured for web - '
|
||||
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||
);
|
||||
}
|
||||
switch (flavor) {
|
||||
case 'dev':
|
||||
return dev.DefaultFirebaseOptions.currentPlatform;
|
||||
case 'staging':
|
||||
return staging.DefaultFirebaseOptions.currentPlatform;
|
||||
case 'prod':
|
||||
return prod.DefaultFirebaseOptions.currentPlatform;
|
||||
default:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions are not supported for this flavor.',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user