Skip to content

Commit 65f2838

Browse files
authored
chore: update project (#26)
* chore: bump deps * refactor: resolve lints * chore: configure firebase * fix: render issue on logout * fix: pop issue on topic * chore: bump agp version * fix: format firebase options
1 parent 973efd4 commit 65f2838

File tree

27 files changed

+303
-182
lines changed

27 files changed

+303
-182
lines changed

android/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "7.4.2" apply false
21+
id "com.android.application" version "8.1.0" apply false
2222
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
2323
id "com.google.gms.google-services" version "4.4.0" apply false
2424
}

firebase.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"flutter":{"platforms":{"android":{"default":{"projectId":"fireship-lessons","appId":"1:758773997881:android:743b0bba6de867fcd1c8e8","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"fireship-lessons","configurations":{"android":"1:758773997881:android:743b0bba6de867fcd1c8e8","ios":"1:758773997881:ios:82656735bc074188d1c8e8"}}}}}}

lib/firebase_options.dart

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// File generated by FlutterFire CLI.
2+
// ignore_for_file: type=lint
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: 'AIzaSyBCCNqoW8gtIn2DYeqlC-dWP8SmiOvRD8Y',
54+
appId: '1:758773997881:android:743b0bba6de867fcd1c8e8',
55+
messagingSenderId: '758773997881',
56+
projectId: 'fireship-lessons',
57+
databaseURL: 'https://fireship-lessons.firebaseio.com',
58+
storageBucket: 'fireship-lessons.appspot.com',
59+
);
60+
61+
static const FirebaseOptions ios = FirebaseOptions(
62+
apiKey: 'AIzaSyCHpFJY54w_YiXjCOfbVbsefn91FFUJ9PE',
63+
appId: '1:758773997881:ios:82656735bc074188d1c8e8',
64+
messagingSenderId: '758773997881',
65+
projectId: 'fireship-lessons',
66+
databaseURL: 'https://fireship-lessons.firebaseio.com',
67+
storageBucket: 'fireship-lessons.appspot.com',
68+
androidClientId:
69+
'758773997881-b4g2gerk1isv5ehq4h9s63hgnn433rjc.apps.googleusercontent.com',
70+
iosClientId:
71+
'758773997881-sk4tfalbk1oqh5f2vv4gbcjqdlm7lq5f.apps.googleusercontent.com',
72+
iosBundleId: 'io.fireship.quizapp',
73+
);
74+
}

lib/login/view/login_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class SignInButton extends StatelessWidget {
187187
style: style,
188188
icon: Icon(icon),
189189
onPressed: onPressed,
190-
label: Expanded(child: child),
190+
label: child,
191191
);
192192
}
193193
return TextButton(

lib/main_development.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import 'package:api_client/api_client.dart';
22
import 'package:quizapp/app/app.dart';
3+
import 'package:quizapp/firebase_options.dart';
34
import 'package:user_repository/user_repository.dart';
45

56
Future<void> main() async {
67
await bootstrap(
7-
init: Firebase.initializeApp,
8+
init: () =>
9+
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform),
810
builder: () async {
911
// ? initialize development dependencies
1012
final userRepository = UserRepository();

lib/main_production.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import 'package:api_client/api_client.dart';
22
import 'package:quizapp/app/app.dart';
3+
import 'package:quizapp/firebase_options.dart';
34
import 'package:user_repository/user_repository.dart';
45

56
Future<void> main() async {
67
await bootstrap(
7-
init: Firebase.initializeApp,
8+
init: () =>
9+
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform),
810
builder: () async {
911
// ? initialize production dependencies
1012
final userRepository = UserRepository();

lib/quiz/view/quiz_page.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ class _QuizBodyState extends State<QuizBody> {
118118
child: const QuizAnswerDetails(),
119119
);
120120
},
121-
).whenComplete(() => context.read<QuizCubit>().unselectOption());
121+
).whenComplete(() {
122+
if (context.mounted) {
123+
context.read<QuizCubit>().unselectOption();
124+
}
125+
});
122126
} else {
123127
context.popUntil((route) => route.settings.name == QuizPage.name);
124128
}

lib/topics/view/topic_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class TopicPage extends StatelessWidget {
2323
Widget build(BuildContext context) {
2424
return PopScope(
2525
canPop: false,
26-
onPopInvoked: (didPop) {
27-
if (!didPop) {
26+
onPopInvokedWithResult: (canPop, __) {
27+
if (!canPop) {
2828
context.flow<TopicsFlowState>().deselectTopic();
2929
}
3030
},

packages/api_client/lib/api_client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// API Client
2-
library api_client;
2+
library;
33

44
export 'package:cloud_firestore/cloud_firestore.dart';
55
export 'package:firebase_auth/firebase_auth.dart';

packages/api_client/pubspec.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ environment:
99
dependencies:
1010
app_core:
1111
path: ../app_core
12-
cloud_firestore: ^4.15.10
13-
firebase_auth: ^4.18.0
14-
firebase_core: ^2.27.2
12+
cloud_firestore: ^5.6.0
13+
firebase_auth: ^5.3.4
14+
firebase_core: ^3.9.0
1515
flutter:
1616
sdk: flutter
17-
google_sign_in: ^6.2.1
18-
sign_in_with_apple: ^6.0.0
17+
google_sign_in: ^6.2.2
18+
sign_in_with_apple: ^6.1.4
1919

2020
dev_dependencies:
21-
very_good_analysis: ^5.1.0
21+
very_good_analysis: ^7.0.0
2222

0 commit comments

Comments
 (0)