Skip to content

Commit eeaf4cd

Browse files
committed
configured firebase
1 parent b2d2985 commit eeaf4cd

File tree

11 files changed

+106
-50
lines changed

11 files changed

+106
-50
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ migrate_working_dir/
3131
.pub-cache/
3232
.pub/
3333
/build/
34+
/android/app/google-services.json
35+
/lib/firebase_options.dart
3436

3537
# Symbolication related
3638
app.*.symbols

android/app/build.gradle

Lines changed: 4 additions & 1 deletion
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

@@ -48,7 +51,7 @@ android {
4851
applicationId "com.example.app"
4952
// You can update the following values to match your application needs.
5053
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
51-
minSdkVersion flutter.minSdkVersion
54+
minSdkVersion 22
5255
targetSdkVersion flutter.targetSdkVersion
5356
versionCode flutterVersionCode.toInteger()
5457
versionName flutterVersionName

android/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ buildscript {
77

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

lib/app.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:flutter/material.dart';
2+
3+
import 'core/routes/app_paths.dart';
4+
import 'core/routes/app_routes.dart';
5+
import 'core/theme/app_theme.dart';
6+
7+
class MyApp extends StatelessWidget {
8+
const MyApp({super.key});
9+
10+
@override
11+
Widget build(BuildContext context) {
12+
return MaterialApp(
13+
title: 'STAGE Todo',
14+
theme: AppTheme.appTheme(context),
15+
onGenerateRoute: AppRoutes.onGenerateRoute,
16+
initialRoute: AppPaths.auth,
17+
);
18+
}
19+
}

lib/main.dart

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
import 'core/routes/app_paths.dart';
2-
import 'core/routes/app_routes.dart';
3-
import 'core/theme/app_theme.dart';
4-
import 'package:flutter/material.dart';
1+
import 'package:firebase_core/firebase_core.dart';
52
import 'package:provider/provider.dart';
63

4+
import 'app.dart';
75
import 'core/common/app_providers.dart';
6+
import 'package:flutter/material.dart';
7+
8+
import 'firebase_options.dart';
9+
10+
void main() async {
11+
WidgetsFlutterBinding.ensureInitialized();
12+
13+
await Firebase.initializeApp(
14+
options: DefaultFirebaseOptions.currentPlatform,
15+
);
816

9-
void main() {
1017
runApp(MultiProvider(
1118
providers: AppProviders.providers,
1219
child: const MyApp(),
1320
));
1421
}
15-
16-
class MyApp extends StatelessWidget {
17-
const MyApp({super.key});
18-
19-
@override
20-
Widget build(BuildContext context) {
21-
return MaterialApp(
22-
title: 'STAGE Todo',
23-
theme: AppTheme.appTheme(context),
24-
onGenerateRoute: AppRoutes.onGenerateRoute,
25-
initialRoute: AppPaths.auth,
26-
);
27-
}
28-
}

macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
import FlutterMacOS
66
import Foundation
77

8+
import cloud_firestore
9+
import firebase_core
810
import path_provider_foundation
911

1012
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
13+
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
14+
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
1115
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
1216
}

pubspec.lock

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Generated by pub
22
# See https://dart.dev/tools/pub/glossary#lockfile
33
packages:
4+
_flutterfire_internals:
5+
dependency: transitive
6+
description:
7+
name: _flutterfire_internals
8+
sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8
9+
url: "https://pub.dev"
10+
source: hosted
11+
version: "1.3.3"
412
async:
513
dependency: transitive
614
description:
@@ -33,6 +41,30 @@ packages:
3341
url: "https://pub.dev"
3442
source: hosted
3543
version: "1.1.1"
44+
cloud_firestore:
45+
dependency: "direct main"
46+
description:
47+
name: cloud_firestore
48+
sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8"
49+
url: "https://pub.dev"
50+
source: hosted
51+
version: "4.8.2"
52+
cloud_firestore_platform_interface:
53+
dependency: transitive
54+
description:
55+
name: cloud_firestore_platform_interface
56+
sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d"
57+
url: "https://pub.dev"
58+
source: hosted
59+
version: "5.15.2"
60+
cloud_firestore_web:
61+
dependency: transitive
62+
description:
63+
name: cloud_firestore_web
64+
sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316
65+
url: "https://pub.dev"
66+
source: hosted
67+
version: "3.6.2"
3668
collection:
3769
dependency: transitive
3870
description:
@@ -81,6 +113,30 @@ packages:
81113
url: "https://pub.dev"
82114
source: hosted
83115
version: "6.1.4"
116+
firebase_core:
117+
dependency: "direct main"
118+
description:
119+
name: firebase_core
120+
sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be
121+
url: "https://pub.dev"
122+
source: hosted
123+
version: "2.14.0"
124+
firebase_core_platform_interface:
125+
dependency: transitive
126+
description:
127+
name: firebase_core_platform_interface
128+
sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2
129+
url: "https://pub.dev"
130+
source: hosted
131+
version: "4.8.0"
132+
firebase_core_web:
133+
dependency: transitive
134+
description:
135+
name: firebase_core_web
136+
sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa"
137+
url: "https://pub.dev"
138+
source: hosted
139+
version: "2.6.0"
84140
flutter:
85141
dependency: "direct main"
86142
description: flutter

pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ dependencies:
3838
google_sign_in: ^6.1.4
3939
intl: ^0.18.1
4040
provider: ^6.0.5
41+
firebase_core: ^2.14.0
42+
cloud_firestore: ^4.8.2
4143

4244
dev_dependencies:
4345
flutter_test:

test/widget_test.dart

Lines changed: 0 additions & 30 deletions
This file was deleted.

windows/flutter/generated_plugin_registrant.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
#include "generated_plugin_registrant.h"
88

9+
#include <firebase_core/firebase_core_plugin_c_api.h>
910

1011
void RegisterPlugins(flutter::PluginRegistry* registry) {
12+
FirebaseCorePluginCApiRegisterWithRegistrar(
13+
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
1114
}

0 commit comments

Comments
 (0)