-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve implementation FlutterFire CLI for multi env
- Loading branch information
Showing
7 changed files
with
85 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
{ | ||
"ENV": "production", | ||
"BASE_URL": "https://reqres.in" | ||
"BASE_URL": "https://reqres.in", | ||
"ANDROID_API_KEY": "AIzaSyCdU1UveIWYwX-Lsmtl7pIigbu5lug-pTU", | ||
"ANDROID_APP_ID": "1:933342696488:android:2a6b2649b130a09e87511d", | ||
"ANDROID_SENDER_ID": "933342696488", | ||
"ANDROID_PROJECT_ID": "mobile-app-bd59b", | ||
"ANDROID_STORAGE_BUCKET": "mobile-app-bd59b.appspot.com", | ||
"IOS_API_KEY": "AIzaSyAPG4_LhFSS94Jez8k20Mu4i7cyCn26hzc", | ||
"IOS_APP_ID": "1:933342696488:ios:3ddb617c88b0363187511d", | ||
"IOS_SENDER_ID": "933342696488", | ||
"IOS_PROJECT_ID": "mobile-app-bd59b", | ||
"IOS_STORAGE_BUCKET": "mobile-app-bd59b.appspot.com", | ||
"IOS_ANDROID_CLIENT_ID": "933342696488-i2co7br6pib2js7a8vsjpio4164n0qci.apps.googleusercontent.com", | ||
"IOS_IOS_CLIENT_ID": "933342696488-ekbqsc1q8pkvk61nj5p0f04061ivr0ug.apps.googleusercontent.com", | ||
"IOS_BUNDLE_ID": "com.lazycatlabs.auths" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
{ | ||
"ENV": "staging", | ||
"BASE_URL": "https://reqres.in" | ||
"BASE_URL": "https://reqres.in", | ||
"ANDROID_API_KEY": "AIzaSyAXDLxYlgYywHeVs8Ch8uOq2t2BmtjOM0s", | ||
"ANDROID_APP_ID": "1:520881115656:android:5ce1808f01692ab2fd77bd", | ||
"ANDROID_SENDER_ID": "520881115656", | ||
"ANDROID_PROJECT_ID": "sample-49e7c", | ||
"ANDROID_STORAGE_BUCKET": "sample-49e7c.appspot.com", | ||
"IOS_API_KEY": "AIzaSyCgylLbnzngRGnumT5dnyfx4foQ2Qdu3dY", | ||
"IOS_APP_ID": "1:520881115656:ios:db518045ccad29fffd77bd", | ||
"IOS_SENDER_ID": "520881115656", | ||
"IOS_PROJECT_ID": "sample-49e7c", | ||
"IOS_STORAGE_BUCKET": "sample-49e7c.appspot.com", | ||
"IOS_ANDROID_CLIENT_ID": "520881115656-a76c2vaojcsa2kj1qk243eclfna6j6ff.apps.googleusercontent.com", | ||
"IOS_IOS_CLIENT_ID": "520881115656-e14k5pcrklmsih46r01nh1fm9gt4oaf0.apps.googleusercontent.com", | ||
"IOS_BUNDLE_ID": "com.lazycatlabs.auths.stg" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export 'firebase_crashlogger.dart'; | ||
export 'firebase_options_prd.dart'; | ||
export 'firebase_options_stg.dart'; | ||
export 'firebase_options.dart'; | ||
export 'firebase_services.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// File generated by FlutterFire CLI. | ||
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members | ||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; | ||
import 'package:flutter/foundation.dart' | ||
show defaultTargetPlatform, kIsWeb, TargetPlatform; | ||
|
||
/// Default [FirebaseOptions] for use with your Firebase apps. | ||
/// | ||
/// Example: | ||
/// ```dart | ||
/// import 'firebase_options.dart'; | ||
/// // ... | ||
/// await Firebase.initializeApp( | ||
/// options: DefaultFirebaseOptionsStg.currentPlatform, | ||
/// ); | ||
/// ``` | ||
class DefaultFirebaseOptions { | ||
static FirebaseOptions get currentPlatform { | ||
if (kIsWeb) { | ||
throw UnsupportedError( | ||
'DefaultFirebaseOptionsStg have not been configured for web - ' | ||
'you can reconfigure this by running the FlutterFire CLI again.', | ||
); | ||
} | ||
switch (defaultTargetPlatform) { | ||
case TargetPlatform.android: | ||
return android; | ||
case TargetPlatform.iOS: | ||
return ios; | ||
default: | ||
throw UnsupportedError( | ||
'DefaultFirebaseOptionsStg are not supported for this platform.', | ||
); | ||
} | ||
} | ||
|
||
static const FirebaseOptions android = FirebaseOptions( | ||
apiKey: String.fromEnvironment("ANDROID_API_KEY"), | ||
appId: String.fromEnvironment("ANDROID_APP_ID"), | ||
messagingSenderId: String.fromEnvironment("ANDROID_SENDER_ID"), | ||
projectId: String.fromEnvironment("ANDROID_PROJECT_ID"), | ||
storageBucket: String.fromEnvironment("ANDROID_STORAGE_BUCKET"), | ||
); | ||
|
||
static const FirebaseOptions ios = FirebaseOptions( | ||
apiKey: String.fromEnvironment("IOS_API_KEY"), | ||
appId: String.fromEnvironment("IOS_APP_ID"), | ||
messagingSenderId: String.fromEnvironment("IOS_SENDER_ID"), | ||
projectId: String.fromEnvironment("IOS_PROJECT_ID"), | ||
storageBucket: String.fromEnvironment("IOS_STORAGE_BUCKET"), | ||
androidClientId: String.fromEnvironment("IOS_ANDROID_CLIENT_ID"), | ||
iosClientId: String.fromEnvironment("IOS_IOS_CLIENT_ID"), | ||
iosBundleId: String.fromEnvironment("IOS_BUNDLE_ID"), | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters