Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {

defaultConfig {
applicationId "dev.flutterexplained.community_app"
minSdkVersion flutter.minSdkVersion
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand All @@ -77,7 +77,7 @@ android {
}

flavorDimensions "default"
productFlavors {
productFlavors {
production {
dimension "default"
applicationIdSuffix ""
Expand Down
70 changes: 17 additions & 53 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
Expand All @@ -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"
}
}
]
Expand Down
6 changes: 3 additions & 3 deletions ios/firebase_app_id_file.json
Original file line number Diff line number Diff line change
@@ -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"
}
14 changes: 12 additions & 2 deletions lib/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -22,14 +24,22 @@ class AppBlocObserver extends BlocObserver {
}
}

Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
Future<void> bootstrap(
FutureOr<Widget> 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()),
Expand Down
6 changes: 3 additions & 3 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
}
71 changes: 71 additions & 0 deletions lib/firebase_options_dev.dart
Original file line number Diff line number Diff line change
@@ -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',
);
}
2 changes: 1 addition & 1 deletion lib/main_development.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion lib/main_production.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion lib/main_staging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}