diff --git a/android/app/build.gradle b/android/app/build.gradle index 847a441..1cc3a81 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -52,7 +52,7 @@ android { defaultConfig { applicationId "dev.flutterexplained.community_app" - minSdkVersion flutter.minSdkVersion + minSdkVersion 23 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName @@ -77,7 +77,7 @@ android { } flavorDimensions "default" - productFlavors { + productFlavors { production { dimension "default" applicationIdSuffix "" diff --git a/android/app/google-services.json b/android/app/google-services.json index b68662c..2625a9d 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,76 +1,40 @@ { "project_info": { - "project_number": "416647339946", - "project_id": "flutter-explained-community", - "storage_bucket": "flutter-explained-community.appspot.com" + "project_number": "904342392027", + "project_id": "fe-community-dev", + "storage_bucket": "fe-community-dev.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:416647339946:android:aeee24df2f82f9d1c9d5d3", + "mobilesdk_app_id": "1:904342392027:android:6e23ad729fa926912ad0fe", "android_client_info": { - "package_name": "com.example.community_app" - } - }, - "oauth_client": [ - { - "client_id": "416647339946-pcveajdsiu5vvsvhuil30jp316kvba35.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBarisN1l9qgQtmg1hzcEC3FRGw_PrUt8A" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "416647339946-pcveajdsiu5vvsvhuil30jp316kvba35.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "416647339946-g6tmvohc21sce0i12if4g819ptfq5svl.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.example.verygoodcore.community-app" - } - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:416647339946:android:6a6e9cdce67d0712c9d5d3", - "android_client_info": { - "package_name": "com.example.verygoodcore.community_app" + "package_name": "dev.flutterexplained.community_app" } }, "oauth_client": [ { - "client_id": "416647339946-pcveajdsiu5vvsvhuil30jp316kvba35.apps.googleusercontent.com", + "client_id": "904342392027-v6bpbj6kq2igl1nh1atihvtnrg4be8gv.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBarisN1l9qgQtmg1hzcEC3FRGw_PrUt8A" + "current_key": "AIzaSyAvJzjCY2WLdII87qwpQQvUqjw0RcRisGM" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "416647339946-pcveajdsiu5vvsvhuil30jp316kvba35.apps.googleusercontent.com", + "client_id": "904342392027-v6bpbj6kq2igl1nh1atihvtnrg4be8gv.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "416647339946-g6tmvohc21sce0i12if4g819ptfq5svl.apps.googleusercontent.com", + "client_id": "904342392027-q5sb99te7uc07m0td6lg8f9kfo4cbohg.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "com.example.verygoodcore.community-app" + "bundle_id": "dev.flutterexplained.community-app.dev" } } ] @@ -79,34 +43,34 @@ }, { "client_info": { - "mobilesdk_app_id": "1:416647339946:android:3b8cbe30444a07bbc9d5d3", + "mobilesdk_app_id": "1:904342392027:android:b2991e3e0348c5482ad0fe", "android_client_info": { - "package_name": "dev.flutterexplained.community_app" + "package_name": "dev.flutterexplained.community_app.dev" } }, "oauth_client": [ { - "client_id": "416647339946-pcveajdsiu5vvsvhuil30jp316kvba35.apps.googleusercontent.com", + "client_id": "904342392027-v6bpbj6kq2igl1nh1atihvtnrg4be8gv.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBarisN1l9qgQtmg1hzcEC3FRGw_PrUt8A" + "current_key": "AIzaSyAvJzjCY2WLdII87qwpQQvUqjw0RcRisGM" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "416647339946-pcveajdsiu5vvsvhuil30jp316kvba35.apps.googleusercontent.com", + "client_id": "904342392027-v6bpbj6kq2igl1nh1atihvtnrg4be8gv.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "416647339946-g6tmvohc21sce0i12if4g819ptfq5svl.apps.googleusercontent.com", + "client_id": "904342392027-q5sb99te7uc07m0td6lg8f9kfo4cbohg.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "com.example.verygoodcore.community-app" + "bundle_id": "dev.flutterexplained.community-app.dev" } } ] diff --git a/ios/firebase_app_id_file.json b/ios/firebase_app_id_file.json index cda477e..1655b6e 100644 --- a/ios/firebase_app_id_file.json +++ b/ios/firebase_app_id_file.json @@ -1,7 +1,7 @@ { "file_generated_by": "FlutterFire CLI", "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", - "GOOGLE_APP_ID": "1:416647339946:ios:7a555c9101c8b460c9d5d3", - "FIREBASE_PROJECT_ID": "flutter-explained-community", - "GCM_SENDER_ID": "416647339946" + "GOOGLE_APP_ID": "1:904342392027:ios:4a2e611a4843f6df2ad0fe", + "FIREBASE_PROJECT_ID": "fe-community-dev", + "GCM_SENDER_ID": "904342392027" } \ No newline at end of file diff --git a/lib/bootstrap.dart b/lib/bootstrap.dart index 82a2574..cee83ae 100644 --- a/lib/bootstrap.dart +++ b/lib/bootstrap.dart @@ -6,6 +6,8 @@ import 'package:community_app/firebase_options.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/widgets.dart'; +enum Environment { dev, staging, prod } + class AppBlocObserver extends BlocObserver { const AppBlocObserver(); @@ -22,14 +24,22 @@ class AppBlocObserver extends BlocObserver { } } -Future bootstrap(FutureOr Function() builder) async { +Future bootstrap( + FutureOr Function() builder, + Environment environment, +) async { WidgetsFlutterBinding.ensureInitialized(); + FlutterError.onError = (details) { log(details.exceptionAsString(), stackTrace: details.stack); }; Bloc.observer = const AppBlocObserver(); - await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + + await Firebase.initializeApp( + name: '$environment', + options: DefaultFirebaseOptions.currentPlatform, + ); await runZonedGuarded( () async => runApp(await builder()), diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart index 799447d..a1de709 100644 --- a/lib/firebase_options.dart +++ b/lib/firebase_options.dart @@ -60,12 +60,12 @@ class DefaultFirebaseOptions { static const FirebaseOptions ios = FirebaseOptions( apiKey: 'AIzaSyBuKomYEqhbFRtOZWQcNOMrDyUd_XFAAvU', - appId: '1:416647339946:ios:7a555c9101c8b460c9d5d3', + appId: '1:416647339946:ios:51dbead1e89cf4edc9d5d3', messagingSenderId: '416647339946', projectId: 'flutter-explained-community', storageBucket: 'flutter-explained-community.appspot.com', iosClientId: - '416647339946-rrjtr8rgl3r5fgtdam9ms3slu91snflm.apps.googleusercontent.com', - iosBundleId: 'dev.flutterexplained.community-app', + '416647339946-58vodha5kfr0oh3v6343dd7pf9rhjfc4.apps.googleusercontent.com', + iosBundleId: 'dev.explained.comm', ); } diff --git a/lib/firebase_options_dev.dart b/lib/firebase_options_dev.dart new file mode 100644 index 0000000..1720f50 --- /dev/null +++ b/lib/firebase_options_dev.dart @@ -0,0 +1,71 @@ +// 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 TargetPlatform, defaultTargetPlatform, kIsWeb; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options_dev.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + throw UnsupportedError( + 'DefaultFirebaseOptions 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; + case TargetPlatform.macOS: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for macos - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.fuchsia: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for fuchsia - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + } + } + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyAvJzjCY2WLdII87qwpQQvUqjw0RcRisGM', + appId: '1:904342392027:android:6e23ad729fa926912ad0fe', + messagingSenderId: '904342392027', + projectId: 'fe-community-dev', + storageBucket: 'fe-community-dev.appspot.com', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyAcA5u44DhgvVnILATaOM_7TAp-vXatL2U', + appId: '1:904342392027:ios:4a2e611a4843f6df2ad0fe', + messagingSenderId: '904342392027', + projectId: 'fe-community-dev', + storageBucket: 'fe-community-dev.appspot.com', + iosClientId: + '904342392027-q5sb99te7uc07m0td6lg8f9kfo4cbohg.apps.googleusercontent.com', + iosBundleId: 'dev.flutterexplained.community-app.dev', + ); +} diff --git a/lib/main_development.dart b/lib/main_development.dart index 107ac95..514d91e 100644 --- a/lib/main_development.dart +++ b/lib/main_development.dart @@ -2,5 +2,5 @@ import 'package:community_app/app/app.dart'; import 'package:community_app/bootstrap.dart'; void main() { - bootstrap(() => const App()); + bootstrap(() => const App(), Environment.dev); } diff --git a/lib/main_production.dart b/lib/main_production.dart index 107ac95..0e97670 100644 --- a/lib/main_production.dart +++ b/lib/main_production.dart @@ -2,5 +2,5 @@ import 'package:community_app/app/app.dart'; import 'package:community_app/bootstrap.dart'; void main() { - bootstrap(() => const App()); + bootstrap(() => const App(), Environment.prod); } diff --git a/lib/main_staging.dart b/lib/main_staging.dart index 107ac95..743ef85 100644 --- a/lib/main_staging.dart +++ b/lib/main_staging.dart @@ -2,5 +2,5 @@ import 'package:community_app/app/app.dart'; import 'package:community_app/bootstrap.dart'; void main() { - bootstrap(() => const App()); + bootstrap(() => const App(), Environment.staging); }