Skip to content

Commit a2334cf

Browse files
committed
Add firebase config
1 parent 4f45a14 commit a2334cf

20 files changed

+321
-18
lines changed

.vscode/launch.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"flutterMode": "profile"
1717
}
1818
],
19-
"dart.flutterSdkPath": "/home/ashutosh/Projects/flutter3/bin/flutter",
20-
"dart.sdkPath": "/home/ashutosh/Projects/flutter3/bin/dart",
21-
19+
"dart.flutterSdkPath": "/Users/ashutoshsingh/flutter3/bin/",
20+
"dart.sdkPath": "/Users/ashutoshsingh/flutter3/bin/dart",
2221
}

android/app/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if (flutterVersionName == null) {
2222
}
2323

2424
apply plugin: 'com.android.application'
25+
// START: FlutterFire Configuration
26+
apply plugin: 'com.google.gms.google-services'
27+
// END: FlutterFire Configuration
2528
apply plugin: 'kotlin-android'
2629
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2730

android/app/google-services.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"project_info": {
3+
"project_number": "755324536390",
4+
"project_id": "portfolio-300c3",
5+
"storage_bucket": "portfolio-300c3.appspot.com"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:755324536390:android:5eae78da0261c3809aec47",
11+
"android_client_info": {
12+
"package_name": "com.example.portfolio"
13+
}
14+
},
15+
"oauth_client": [
16+
{
17+
"client_id": "755324536390-7n97k3dbo4tvetfh98t9qac8tau68k6o.apps.googleusercontent.com",
18+
"client_type": 3
19+
}
20+
],
21+
"api_key": [
22+
{
23+
"current_key": "AIzaSyCHHYfnrhzawOnMubdlzyKIV-OnpFeJksY"
24+
}
25+
],
26+
"services": {
27+
"appinvite_service": {
28+
"other_platform_oauth_client": [
29+
{
30+
"client_id": "755324536390-7n97k3dbo4tvetfh98t9qac8tau68k6o.apps.googleusercontent.com",
31+
"client_type": 3
32+
}
33+
]
34+
}
35+
}
36+
}
37+
],
38+
"configuration_version": "1"
39+
}

android/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ buildscript {
77

88
dependencies {
99
classpath 'com.android.tools.build:gradle:4.1.0'
10+
// START: FlutterFire Configuration
11+
classpath 'com.google.gms:google-services:4.3.10'
12+
// END: FlutterFire Configuration
1013
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1114
}
1215
}

ios/Flutter/Debug.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"

ios/Flutter/Release.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

ios/Podfile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35+
end
36+
37+
post_install do |installer|
38+
installer.pods_project.targets.each do |target|
39+
flutter_additional_ios_build_settings(target)
40+
end
41+
end

ios/Runner.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4343
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4444
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
45+
E066262860555688F87ABC6E /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
4546
/* End PBXFileReference section */
4647

4748
/* Begin PBXFrameworksBuildPhase section */
@@ -72,6 +73,7 @@
7273
9740EEB11CF90186004384FC /* Flutter */,
7374
97C146F01CF9000F007C117D /* Runner */,
7475
97C146EF1CF9000F007C117D /* Products */,
76+
E066262860555688F87ABC6E /* GoogleService-Info.plist */,
7577
);
7678
sourceTree = "<group>";
7779
};

ios/Runner/GoogleService-Info.plist

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CLIENT_ID</key>
6+
<string>755324536390-ovi75d7m4c1slmbm38rqsja23u82603o.apps.googleusercontent.com</string>
7+
<key>REVERSED_CLIENT_ID</key>
8+
<string>com.googleusercontent.apps.755324536390-ovi75d7m4c1slmbm38rqsja23u82603o</string>
9+
<key>API_KEY</key>
10+
<string>AIzaSyAtHfF3jJ2isRhoc702rehlFFwSUyQ8c-Q</string>
11+
<key>GCM_SENDER_ID</key>
12+
<string>755324536390</string>
13+
<key>PLIST_VERSION</key>
14+
<string>1</string>
15+
<key>BUNDLE_ID</key>
16+
<string>com.example.portfolio</string>
17+
<key>PROJECT_ID</key>
18+
<string>portfolio-300c3</string>
19+
<key>STORAGE_BUCKET</key>
20+
<string>portfolio-300c3.appspot.com</string>
21+
<key>IS_ADS_ENABLED</key>
22+
<false></false>
23+
<key>IS_ANALYTICS_ENABLED</key>
24+
<false></false>
25+
<key>IS_APPINVITE_ENABLED</key>
26+
<true></true>
27+
<key>IS_GCM_ENABLED</key>
28+
<true></true>
29+
<key>IS_SIGNIN_ENABLED</key>
30+
<true></true>
31+
<key>GOOGLE_APP_ID</key>
32+
<string>1:755324536390:ios:1682adbd2a990b279aec47</string>
33+
</dict>
34+
</plist>

ios/firebase_app_id_file.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"file_generated_by": "FlutterFire CLI",
3+
"purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
4+
"GOOGLE_APP_ID": "1:755324536390:ios:1682adbd2a990b279aec47",
5+
"FIREBASE_PROJECT_ID": "portfolio-300c3",
6+
"GCM_SENDER_ID": "755324536390"
7+
}

lib/firebase_options.dart

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
return web;
21+
}
22+
switch (defaultTargetPlatform) {
23+
case TargetPlatform.android:
24+
return android;
25+
case TargetPlatform.iOS:
26+
return ios;
27+
case TargetPlatform.macOS:
28+
return macos;
29+
case TargetPlatform.windows:
30+
throw UnsupportedError(
31+
'DefaultFirebaseOptions have not been configured for windows - '
32+
'you can reconfigure this by running the FlutterFire CLI again.',
33+
);
34+
case TargetPlatform.linux:
35+
throw UnsupportedError(
36+
'DefaultFirebaseOptions have not been configured for linux - '
37+
'you can reconfigure this by running the FlutterFire CLI again.',
38+
);
39+
default:
40+
throw UnsupportedError(
41+
'DefaultFirebaseOptions are not supported for this platform.',
42+
);
43+
}
44+
}
45+
46+
static const FirebaseOptions web = FirebaseOptions(
47+
apiKey: 'AIzaSyDC-X89w34CRpXhsYj-yg11GP6xAZqtEWM',
48+
appId: '1:755324536390:web:5c0990ad75b624269aec47',
49+
messagingSenderId: '755324536390',
50+
projectId: 'portfolio-300c3',
51+
authDomain: 'portfolio-300c3.firebaseapp.com',
52+
storageBucket: 'portfolio-300c3.appspot.com',
53+
measurementId: 'G-XCRCBL3FRJ',
54+
);
55+
56+
static const FirebaseOptions android = FirebaseOptions(
57+
apiKey: 'AIzaSyCHHYfnrhzawOnMubdlzyKIV-OnpFeJksY',
58+
appId: '1:755324536390:android:5eae78da0261c3809aec47',
59+
messagingSenderId: '755324536390',
60+
projectId: 'portfolio-300c3',
61+
storageBucket: 'portfolio-300c3.appspot.com',
62+
);
63+
64+
static const FirebaseOptions ios = FirebaseOptions(
65+
apiKey: 'AIzaSyAtHfF3jJ2isRhoc702rehlFFwSUyQ8c-Q',
66+
appId: '1:755324536390:ios:1682adbd2a990b279aec47',
67+
messagingSenderId: '755324536390',
68+
projectId: 'portfolio-300c3',
69+
storageBucket: 'portfolio-300c3.appspot.com',
70+
iosClientId: '755324536390-ovi75d7m4c1slmbm38rqsja23u82603o.apps.googleusercontent.com',
71+
iosBundleId: 'com.example.portfolio',
72+
);
73+
74+
static const FirebaseOptions macos = FirebaseOptions(
75+
apiKey: 'AIzaSyAtHfF3jJ2isRhoc702rehlFFwSUyQ8c-Q',
76+
appId: '1:755324536390:ios:1682adbd2a990b279aec47',
77+
messagingSenderId: '755324536390',
78+
projectId: 'portfolio-300c3',
79+
storageBucket: 'portfolio-300c3.appspot.com',
80+
iosClientId: '755324536390-ovi75d7m4c1slmbm38rqsja23u82603o.apps.googleusercontent.com',
81+
iosBundleId: 'com.example.portfolio',
82+
);
83+
}

lib/main.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:firebase_core/firebase_core.dart';
22
import 'package:flutter/material.dart';
33
import 'package:flutter_localizations/flutter_localizations.dart';
44
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
5+
import 'package:portfolio/firebase_options.dart';
56
import 'package:portfolio/generated/l10n.dart';
67
import 'package:portfolio/style/app_theme.dart';
78
import 'package:portfolio/style/colours.dart';
@@ -12,7 +13,11 @@ import 'package:responsive_builder/responsive_builder.dart';
1213
void main() async {
1314
setUrlStrategy(PathUrlStrategy());
1415
WidgetsFlutterBinding.ensureInitialized();
15-
await Firebase.initializeApp();
16+
17+
await Firebase.initializeApp(
18+
options: DefaultFirebaseOptions.currentPlatform,
19+
);
20+
1621
ResponsiveSizingConfig.instance.setCustomBreakpoints(
1722
ScreenBreakpoints(
1823
desktop: (Constants.halfScreenWidth + Constants.globalPadding) * 2,

macos/Flutter/Flutter-Debug.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "ephemeral/Flutter-Generated.xcconfig"
+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "ephemeral/Flutter-Generated.xcconfig"

macos/Podfile

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
platform :osx, '10.11'
2+
3+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5+
6+
project 'Runner', {
7+
'Debug' => :debug,
8+
'Profile' => :release,
9+
'Release' => :release,
10+
}
11+
12+
def flutter_root
13+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14+
unless File.exist?(generated_xcode_build_settings_path)
15+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16+
end
17+
18+
File.foreach(generated_xcode_build_settings_path) do |line|
19+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
20+
return matches[1].strip if matches
21+
end
22+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23+
end
24+
25+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26+
27+
flutter_macos_podfile_setup
28+
29+
target 'Runner' do
30+
use_frameworks!
31+
use_modular_headers!
32+
33+
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34+
end
35+
36+
post_install do |installer|
37+
installer.pods_project.targets.each do |target|
38+
flutter_additional_macos_build_settings(target)
39+
end
40+
end

macos/Runner.xcodeproj/project.pbxproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
/* Begin PBXFileReference section */
5555
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
5656
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
57-
33CC10ED2044A3C60003C045 /* portfolio.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "portfolio.app"; sourceTree = BUILT_PRODUCTS_DIR; };
57+
33CC10ED2044A3C60003C045 /* portfolio.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = portfolio.app; sourceTree = BUILT_PRODUCTS_DIR; };
5858
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
5959
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
6060
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@@ -66,6 +66,7 @@
6666
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
6767
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
6868
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
69+
3DEA407234D91F6CE88FB683 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
6970
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
7071
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
7172
/* End PBXFileReference section */
@@ -99,6 +100,7 @@
99100
33CEB47122A05771004F2AC0 /* Flutter */,
100101
33CC10EE2044A3C60003C045 /* Products */,
101102
D73912EC22F37F3D000D13A0 /* Frameworks */,
103+
3DEA407234D91F6CE88FB683 /* GoogleService-Info.plist */,
102104
);
103105
sourceTree = "<group>";
104106
};

macos/Runner/GoogleService-Info.plist

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CLIENT_ID</key>
6+
<string>755324536390-ovi75d7m4c1slmbm38rqsja23u82603o.apps.googleusercontent.com</string>
7+
<key>REVERSED_CLIENT_ID</key>
8+
<string>com.googleusercontent.apps.755324536390-ovi75d7m4c1slmbm38rqsja23u82603o</string>
9+
<key>API_KEY</key>
10+
<string>AIzaSyAtHfF3jJ2isRhoc702rehlFFwSUyQ8c-Q</string>
11+
<key>GCM_SENDER_ID</key>
12+
<string>755324536390</string>
13+
<key>PLIST_VERSION</key>
14+
<string>1</string>
15+
<key>BUNDLE_ID</key>
16+
<string>com.example.portfolio</string>
17+
<key>PROJECT_ID</key>
18+
<string>portfolio-300c3</string>
19+
<key>STORAGE_BUCKET</key>
20+
<string>portfolio-300c3.appspot.com</string>
21+
<key>IS_ADS_ENABLED</key>
22+
<false></false>
23+
<key>IS_ANALYTICS_ENABLED</key>
24+
<false></false>
25+
<key>IS_APPINVITE_ENABLED</key>
26+
<true></true>
27+
<key>IS_GCM_ENABLED</key>
28+
<true></true>
29+
<key>IS_SIGNIN_ENABLED</key>
30+
<true></true>
31+
<key>GOOGLE_APP_ID</key>
32+
<string>1:755324536390:ios:1682adbd2a990b279aec47</string>
33+
</dict>
34+
</plist>

0 commit comments

Comments
 (0)