Skip to content

Commit 69eef4d

Browse files
committed
038-Added final code from tutorial recording
1 parent 25580b9 commit 69eef4d

File tree

10 files changed

+40
-70
lines changed

10 files changed

+40
-70
lines changed

038-firebase-authentication/01-final/android/app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,4 @@ dependencies {
6060
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
6161
}
6262

63-
// ADD THIS AT THE BOTTOM
6463
apply plugin: 'com.google.gms.google-services'

038-firebase-authentication/01-final/android/app/google-services.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{
22
"project_info": {
3-
"project_number": "538268492548",
4-
"firebase_url": "https://compound-58b9c.firebaseio.com",
5-
"project_id": "compound-58b9c",
6-
"storage_bucket": "compound-58b9c.appspot.com"
3+
"project_number": "331279878066",
4+
"firebase_url": "https://compound-53007.firebaseio.com",
5+
"project_id": "compound-53007",
6+
"storage_bucket": "compound-53007.appspot.com"
77
},
88
"client": [
99
{
1010
"client_info": {
11-
"mobilesdk_app_id": "1:538268492548:android:7ffce310e1664462d46651",
11+
"mobilesdk_app_id": "1:331279878066:android:1ef0f6db1c2863bf8086ab",
1212
"android_client_info": {
1313
"package_name": "com.filledstacks.compound"
1414
}
1515
},
1616
"oauth_client": [
1717
{
18-
"client_id": "538268492548-r4pk3r4nemih3nudv20u5lrru1pov3q0.apps.googleusercontent.com",
18+
"client_id": "331279878066-bvogemandlhf398c0bev59b4rtkq3c7k.apps.googleusercontent.com",
1919
"client_type": 3
2020
}
2121
],
2222
"api_key": [
2323
{
24-
"current_key": "AIzaSyDkTL20MicJvWSURM42OwCC5XlD6T-SBBQ"
24+
"current_key": "AIzaSyBxJVZjb_x3e9kJTM4x1i48rDOogJ6ISfk"
2525
}
2626
],
2727
"services": {
2828
"appinvite_service": {
2929
"other_platform_oauth_client": [
3030
{
31-
"client_id": "538268492548-r4pk3r4nemih3nudv20u5lrru1pov3q0.apps.googleusercontent.com",
31+
"client_id": "331279878066-bvogemandlhf398c0bev59b4rtkq3c7k.apps.googleusercontent.com",
3232
"client_type": 3
3333
}
3434
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
const String LoginViewRoute = "LoginView";
22
const String SignUpViewRoute = "SignUp";
33
const String HomeViewRoute = "HomeView";
4-
// Generate the views here
4+
// Generate the views here

038-firebase-authentication/01-final/lib/services/authentication_service.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import 'package:flutter/foundation.dart';
21
import 'package:firebase_auth/firebase_auth.dart';
2+
import 'package:flutter/foundation.dart';
33

44
class AuthenticationService {
55
final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
@@ -10,7 +10,9 @@ class AuthenticationService {
1010
}) async {
1111
try {
1212
var user = await _firebaseAuth.signInWithEmailAndPassword(
13-
email: email, password: password);
13+
email: email,
14+
password: password,
15+
);
1416
return user != null;
1517
} catch (e) {
1618
return e.message;
@@ -23,8 +25,9 @@ class AuthenticationService {
2325
}) async {
2426
try {
2527
var authResult = await _firebaseAuth.createUserWithEmailAndPassword(
26-
email: email, password: password);
27-
28+
email: email,
29+
password: password,
30+
);
2831
return authResult.user != null;
2932
} catch (e) {
3033
return e.message;

038-firebase-authentication/01-final/lib/ui/views/base_widget.dart

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

038-firebase-authentication/01-final/lib/ui/views/home_view.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ class HomeView extends StatelessWidget {
55

66
@override
77
Widget build(BuildContext context) {
8-
return Scaffold(
9-
body: Center(
10-
child: Text('Home'),
11-
),
8+
return Center(
9+
child: Text('Home'),
1210
);
1311
}
1412
}

038-firebase-authentication/01-final/lib/viewmodels/login_view_model.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ class LoginViewModel extends BaseModel {
1313
final DialogService _dialogService = locator<DialogService>();
1414
final NavigationService _navigationService = locator<NavigationService>();
1515

16-
Future login({@required String email, @required String password}) async {
16+
Future login({
17+
@required String email,
18+
@required String password,
19+
}) async {
1720
setBusy(true);
1821

1922
var result = await _authenticationService.loginWithEmail(
20-
email: email, password: password);
23+
email: email,
24+
password: password,
25+
);
2126

2227
setBusy(false);
2328

@@ -27,7 +32,7 @@ class LoginViewModel extends BaseModel {
2732
} else {
2833
await _dialogService.showDialog(
2934
title: 'Login Failure',
30-
description: 'Couldn\'t login at this moment. Please try again later',
35+
description: 'General login failure. Please try again later',
3136
);
3237
}
3338
} else {

038-firebase-authentication/01-final/lib/viewmodels/signup_view_model.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ class SignUpViewModel extends BaseModel {
1313
final DialogService _dialogService = locator<DialogService>();
1414
final NavigationService _navigationService = locator<NavigationService>();
1515

16-
Future signUp({@required String email, @required String password}) async {
16+
Future signUp({
17+
@required String email,
18+
@required String password,
19+
}) async {
1720
setBusy(true);
1821

1922
var result = await _authenticationService.signUpWithEmail(
20-
email: email, password: password);
23+
email: email,
24+
password: password,
25+
);
2126

2227
setBusy(false);
2328

038-firebase-authentication/01-final/pubspec.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,35 +70,35 @@ packages:
7070
name: firebase
7171
url: "https://pub.dartlang.org"
7272
source: hosted
73-
version: "7.1.0"
73+
version: "7.2.0"
7474
firebase_auth:
7575
dependency: "direct main"
7676
description:
7777
name: firebase_auth
7878
url: "https://pub.dartlang.org"
7979
source: hosted
80-
version: "0.15.3"
80+
version: "0.15.3+1"
8181
firebase_auth_platform_interface:
8282
dependency: transitive
8383
description:
8484
name: firebase_auth_platform_interface
8585
url: "https://pub.dartlang.org"
8686
source: hosted
87-
version: "1.1.3"
87+
version: "1.1.5"
8888
firebase_auth_web:
8989
dependency: transitive
9090
description:
9191
name: firebase_auth_web
9292
url: "https://pub.dartlang.org"
9393
source: hosted
94-
version: "0.1.1+1"
94+
version: "0.1.1+2"
9595
firebase_core:
9696
dependency: transitive
9797
description:
9898
name: firebase_core
9999
url: "https://pub.dartlang.org"
100100
source: hosted
101-
version: "0.4.3+1"
101+
version: "0.4.3+2"
102102
firebase_core_platform_interface:
103103
dependency: transitive
104104
description:
@@ -112,7 +112,7 @@ packages:
112112
name: firebase_core_web
113113
url: "https://pub.dartlang.org"
114114
source: hosted
115-
version: "0.1.1+1"
115+
version: "0.1.1+2"
116116
flutter:
117117
dependency: "direct main"
118118
description: flutter
@@ -288,5 +288,5 @@ packages:
288288
source: hosted
289289
version: "3.5.0"
290290
sdks:
291-
dart: ">=2.4.0 <3.0.0"
291+
dart: ">=2.7.0-dev <3.0.0"
292292
flutter: ">=1.12.13+hotfix.4 <2.0.0"

038-firebase-authentication/01-final/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ environment:
1919
dependencies:
2020
flutter:
2121
sdk: flutter
22-
2322
# The following adds the Cupertino Icons font to your application.
2423
# Use with the CupertinoIcons class for iOS style icons.
2524
cupertino_icons: ^0.1.2

0 commit comments

Comments
 (0)