Refactor application package structure and update Firebase iOS bundle IDs for different environments.

This commit is contained in:
Faris Armoush
2025-07-13 12:37:53 +03:00
parent e1b0d56cfd
commit c4fa2256f0
9 changed files with 18 additions and 15 deletions

View File

@ -17,8 +17,7 @@ import 'package:syncrow_app/firebase_options_staging.dart' as staging;
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
const flavor = String.fromEnvironment('flavor');
static FirebaseOptions currentPlatform(String flavor) {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
@ -30,12 +29,13 @@ class DefaultFirebaseOptions {
return dev.DefaultFirebaseOptions.currentPlatform;
case 'staging':
return staging.DefaultFirebaseOptions.currentPlatform;
case 'prod':
case 'production':
return prod.DefaultFirebaseOptions.currentPlatform;
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this flavor.',
);
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
}
}