Skip to content

Commit

Permalink
firebase options modularization done
Browse files Browse the repository at this point in the history
  • Loading branch information
Abbujaa committed Mar 30, 2024
1 parent d5a2c83 commit db747bf
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 74 deletions.
10 changes: 10 additions & 0 deletions lib/android_firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:firebase_core/firebase_core.dart';

final FirebaseOptions androidFirebaseOptions = FirebaseOptions(
apiKey: 'AIzaSyBiK-huaMXXmnI4M0LxYNtH5NasP1o1iHQ',
appId: '1:331315801686:android:28c596f9e2e592e17595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
);
83 changes: 9 additions & 74 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -1,89 +1,24 @@
// 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;
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform;

import 'web_firebase_options.dart' if (dart.library.html) 'web_firebase_options.dart';
import 'android_firebase_options.dart' if (dart.library.io) 'android_firebase_options.dart';
import 'ios_firebase_options.dart' if (dart.library.io) 'ios_firebase_options.dart';

/// 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 {
if (kIsWeb) {
return web;
return webFirebaseOptions;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
return androidFirebaseOptions;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
return macos;
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.',
);
return iosFirebaseOptions;
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}

static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSyBJKvh4ZXb3npq8cL9-mk-kDlSIUO6VppU',
appId: '1:331315801686:web:2a2609fb7d0ec4187595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
authDomain: 'guardiancare-a210f.firebaseapp.com',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
measurementId: 'G-HRJ3C6VEXP',
);

static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyBiK-huaMXXmnI4M0LxYNtH5NasP1o1iHQ',
appId: '1:331315801686:android:28c596f9e2e592e17595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
);

static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyDwCbSP-Qw1bRg5BvVco5x0VqxoBMAtLgs',
appId: '1:331315801686:ios:3e6128afd380d53a7595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
androidClientId: '331315801686-4co8knverqologscscu70sip0c3iqqd3.apps.googleusercontent.com',
iosClientId: '331315801686-4h0llgi3p79eam8n5bt5vhm735plbg7h.apps.googleusercontent.com',
iosBundleId: 'com.guardiancare.guardiancare',
);

static const FirebaseOptions macos = FirebaseOptions(
apiKey: 'AIzaSyDwCbSP-Qw1bRg5BvVco5x0VqxoBMAtLgs',
appId: '1:331315801686:ios:cef1e3afa0308d3d7595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
androidClientId: '331315801686-4co8knverqologscscu70sip0c3iqqd3.apps.googleusercontent.com',
iosClientId: '331315801686-drnf2arr18matomgvs169374mbk0jgud.apps.googleusercontent.com',
iosBundleId: 'com.guardiancare.guardiancare.RunnerTests',
);
}
13 changes: 13 additions & 0 deletions lib/ios_firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:firebase_core/firebase_core.dart';

final FirebaseOptions iosFirebaseOptions = FirebaseOptions(
apiKey: 'AIzaSyDwCbSP-Qw1bRg5BvVco5x0VqxoBMAtLgs',
appId: '1:331315801686:ios:3e6128afd380d53a7595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
androidClientId: '331315801686-4co8knverqologscscu70sip0c3iqqd3.apps.googleusercontent.com',
iosClientId: '331315801686-4h0llgi3p79eam8n5bt5vhm735plbg7h.apps.googleusercontent.com',
iosBundleId: 'com.guardiancare.guardiancare',
);
12 changes: 12 additions & 0 deletions lib/web_firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:firebase_core/firebase_core.dart';

final FirebaseOptions webFirebaseOptions = FirebaseOptions(
apiKey: 'AIzaSyBJKvh4ZXb3npq8cL9-mk-kDlSIUO6VppU',
appId: '1:331315801686:web:2a2609fb7d0ec4187595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
authDomain: 'guardiancare-a210f.firebaseapp.com',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
measurementId: 'G-HRJ3C6VEXP',
);

0 comments on commit db747bf

Please sign in to comment.