Skip to content

Commit 14952ec

Browse files
committed
Add app/lib/firebase_options.dart back
1 parent 1b924a4 commit 14952ec

File tree

14 files changed

+210
-12
lines changed

14 files changed

+210
-12
lines changed

in_app_purchases/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

in_app_purchases/codelab_rebuild.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ steps:
1414
patch-u: |
1515
--- b/in_app_purchases/step_00/app/.gitignore
1616
+++ a/in_app_purchases/step_00/app/.gitignore
17-
@@ -43,3 +43,9 @@ app.*.map.json
17+
@@ -43,3 +43,8 @@ app.*.map.json
1818
/android/app/debug
1919
/android/app/profile
2020
/android/app/release
@@ -23,7 +23,6 @@ steps:
2323
+GoogleService-Info.plist
2424
+google-services.json
2525
+ios/firebase_app_id_file.json
26-
+lib/firebase_options.dart
2726
- name: Add app dependencies
2827
path: steps/app
2928
flutter: pub add cloud_firestore cupertino_icons firebase_auth firebase_core google_sign_in http intl provider

in_app_purchases/step_00/app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ app.*.map.json
4848
GoogleService-Info.plist
4949
google-services.json
5050
ios/firebase_app_id_file.json
51-
lib/firebase_options.dart

in_app_purchases/step_03/app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ app.*.map.json
4848
GoogleService-Info.plist
4949
google-services.json
5050
ios/firebase_app_id_file.json
51-
lib/firebase_options.dart
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// File generated by FlutterFire CLI.
2+
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
3+
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
4+
import 'package:flutter/foundation.dart'
5+
show defaultTargetPlatform, kIsWeb, TargetPlatform;
6+
7+
/// Default [FirebaseOptions] for use with your Firebase apps.
8+
///
9+
/// Example:
10+
/// ```dart
11+
/// import 'firebase_options.dart';
12+
/// // ...
13+
/// await Firebase.initializeApp(
14+
/// options: DefaultFirebaseOptions.currentPlatform,
15+
/// );
16+
/// ```
17+
class DefaultFirebaseOptions {
18+
static FirebaseOptions get currentPlatform {
19+
if (kIsWeb) {
20+
throw UnsupportedError(
21+
'DefaultFirebaseOptions have not been configured for web - '
22+
'you can reconfigure this by running the FlutterFire CLI again.',
23+
);
24+
}
25+
switch (defaultTargetPlatform) {
26+
case TargetPlatform.android:
27+
return android;
28+
case TargetPlatform.iOS:
29+
return ios;
30+
case TargetPlatform.macOS:
31+
throw UnsupportedError(
32+
'DefaultFirebaseOptions have not been configured for macos - '
33+
'you can reconfigure this by running the FlutterFire CLI again.',
34+
);
35+
case TargetPlatform.windows:
36+
throw UnsupportedError(
37+
'DefaultFirebaseOptions have not been configured for windows - '
38+
'you can reconfigure this by running the FlutterFire CLI again.',
39+
);
40+
case TargetPlatform.linux:
41+
throw UnsupportedError(
42+
'DefaultFirebaseOptions have not been configured for linux - '
43+
'you can reconfigure this by running the FlutterFire CLI again.',
44+
);
45+
default:
46+
throw UnsupportedError(
47+
'DefaultFirebaseOptions are not supported for this platform.',
48+
);
49+
}
50+
}
51+
52+
static const FirebaseOptions android = FirebaseOptions(
53+
apiKey: 'API KEY',
54+
appId: 'APP ID',
55+
messagingSenderId: 'SENDER ID',
56+
projectId: 'PROJECT ID',
57+
storageBucket: 'STORAGE BUCKET',
58+
);
59+
60+
static const FirebaseOptions ios = FirebaseOptions(
61+
apiKey: 'API KEY',
62+
appId: 'APP ID',
63+
messagingSenderId: 'SENDER ID',
64+
projectId: 'PROJECT ID',
65+
storageBucket: 'STORAGE BUCKET',
66+
iosClientId: 'CLIENT ID',
67+
iosBundleId: 'BUNDLE ID',
68+
);
69+
}

in_app_purchases/step_07/app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ app.*.map.json
4848
GoogleService-Info.plist
4949
google-services.json
5050
ios/firebase_app_id_file.json
51-
lib/firebase_options.dart
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// File generated by FlutterFire CLI.
2+
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
3+
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
4+
import 'package:flutter/foundation.dart'
5+
show defaultTargetPlatform, kIsWeb, TargetPlatform;
6+
7+
/// Default [FirebaseOptions] for use with your Firebase apps.
8+
///
9+
/// Example:
10+
/// ```dart
11+
/// import 'firebase_options.dart';
12+
/// // ...
13+
/// await Firebase.initializeApp(
14+
/// options: DefaultFirebaseOptions.currentPlatform,
15+
/// );
16+
/// ```
17+
class DefaultFirebaseOptions {
18+
static FirebaseOptions get currentPlatform {
19+
if (kIsWeb) {
20+
throw UnsupportedError(
21+
'DefaultFirebaseOptions have not been configured for web - '
22+
'you can reconfigure this by running the FlutterFire CLI again.',
23+
);
24+
}
25+
switch (defaultTargetPlatform) {
26+
case TargetPlatform.android:
27+
return android;
28+
case TargetPlatform.iOS:
29+
return ios;
30+
case TargetPlatform.macOS:
31+
throw UnsupportedError(
32+
'DefaultFirebaseOptions have not been configured for macos - '
33+
'you can reconfigure this by running the FlutterFire CLI again.',
34+
);
35+
case TargetPlatform.windows:
36+
throw UnsupportedError(
37+
'DefaultFirebaseOptions have not been configured for windows - '
38+
'you can reconfigure this by running the FlutterFire CLI again.',
39+
);
40+
case TargetPlatform.linux:
41+
throw UnsupportedError(
42+
'DefaultFirebaseOptions have not been configured for linux - '
43+
'you can reconfigure this by running the FlutterFire CLI again.',
44+
);
45+
default:
46+
throw UnsupportedError(
47+
'DefaultFirebaseOptions are not supported for this platform.',
48+
);
49+
}
50+
}
51+
52+
static const FirebaseOptions android = FirebaseOptions(
53+
apiKey: 'API KEY',
54+
appId: 'APP ID',
55+
messagingSenderId: 'SENDER ID',
56+
projectId: 'PROJECT ID',
57+
storageBucket: 'STORAGE BUCKET',
58+
);
59+
60+
static const FirebaseOptions ios = FirebaseOptions(
61+
apiKey: 'API KEY',
62+
appId: 'APP ID',
63+
messagingSenderId: 'SENDER ID',
64+
projectId: 'PROJECT ID',
65+
storageBucket: 'STORAGE BUCKET',
66+
iosClientId: 'CLIENT ID',
67+
iosBundleId: 'BUNDLE ID',
68+
);
69+
}

in_app_purchases/step_08/app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ app.*.map.json
4848
GoogleService-Info.plist
4949
google-services.json
5050
ios/firebase_app_id_file.json
51-
lib/firebase_options.dart

in_app_purchases/step_09/app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ app.*.map.json
4848
GoogleService-Info.plist
4949
google-services.json
5050
ios/firebase_app_id_file.json
51-
lib/firebase_options.dart

in_app_purchases/step_10/app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ app.*.map.json
4848
GoogleService-Info.plist
4949
google-services.json
5050
ios/firebase_app_id_file.json
51-
lib/firebase_options.dart

0 commit comments

Comments
 (0)