firebase prod setup and flavors enhancement.

This commit is contained in:
Faris Armoush
2025-07-13 11:49:58 +03:00
parent 743d6cc5c6
commit e1b0d56cfd
26 changed files with 939 additions and 321 deletions

41
lib/firebase_options.dart Normal file
View 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.',
);
}
}
}