File tree Expand file tree Collapse file tree 10 files changed +40
-70
lines changed
038-firebase-authentication/01-final Expand file tree Collapse file tree 10 files changed +40
-70
lines changed Original file line number Diff line number Diff line change @@ -60,5 +60,4 @@ dependencies {
60
60
androidTestImplementation ' androidx.test.espresso:espresso-core:3.1.1'
61
61
}
62
62
63
- // ADD THIS AT THE BOTTOM
64
63
apply plugin : ' com.google.gms.google-services'
Original file line number Diff line number Diff line change 1
1
{
2
2
"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"
7
7
},
8
8
"client" : [
9
9
{
10
10
"client_info" : {
11
- "mobilesdk_app_id" : " 1:538268492548 :android:7ffce310e1664462d46651 " ,
11
+ "mobilesdk_app_id" : " 1:331279878066 :android:1ef0f6db1c2863bf8086ab " ,
12
12
"android_client_info" : {
13
13
"package_name" : " com.filledstacks.compound"
14
14
}
15
15
},
16
16
"oauth_client" : [
17
17
{
18
- "client_id" : " 538268492548-r4pk3r4nemih3nudv20u5lrru1pov3q0 .apps.googleusercontent.com" ,
18
+ "client_id" : " 331279878066-bvogemandlhf398c0bev59b4rtkq3c7k .apps.googleusercontent.com" ,
19
19
"client_type" : 3
20
20
}
21
21
],
22
22
"api_key" : [
23
23
{
24
- "current_key" : " AIzaSyDkTL20MicJvWSURM42OwCC5XlD6T-SBBQ "
24
+ "current_key" : " AIzaSyBxJVZjb_x3e9kJTM4x1i48rDOogJ6ISfk "
25
25
}
26
26
],
27
27
"services" : {
28
28
"appinvite_service" : {
29
29
"other_platform_oauth_client" : [
30
30
{
31
- "client_id" : " 538268492548-r4pk3r4nemih3nudv20u5lrru1pov3q0 .apps.googleusercontent.com" ,
31
+ "client_id" : " 331279878066-bvogemandlhf398c0bev59b4rtkq3c7k .apps.googleusercontent.com" ,
32
32
"client_type" : 3
33
33
}
34
34
]
Original file line number Diff line number Diff line change 1
1
const String LoginViewRoute = "LoginView" ;
2
2
const String SignUpViewRoute = "SignUp" ;
3
3
const String HomeViewRoute = "HomeView" ;
4
- // Generate the views here
4
+ // Generate the views here
Original file line number Diff line number Diff line change 1
- import 'package:flutter/foundation.dart' ;
2
1
import 'package:firebase_auth/firebase_auth.dart' ;
2
+ import 'package:flutter/foundation.dart' ;
3
3
4
4
class AuthenticationService {
5
5
final FirebaseAuth _firebaseAuth = FirebaseAuth .instance;
@@ -10,7 +10,9 @@ class AuthenticationService {
10
10
}) async {
11
11
try {
12
12
var user = await _firebaseAuth.signInWithEmailAndPassword (
13
- email: email, password: password);
13
+ email: email,
14
+ password: password,
15
+ );
14
16
return user != null ;
15
17
} catch (e) {
16
18
return e.message;
@@ -23,8 +25,9 @@ class AuthenticationService {
23
25
}) async {
24
26
try {
25
27
var authResult = await _firebaseAuth.createUserWithEmailAndPassword (
26
- email: email, password: password);
27
-
28
+ email: email,
29
+ password: password,
30
+ );
28
31
return authResult.user != null ;
29
32
} catch (e) {
30
33
return e.message;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,10 +5,8 @@ class HomeView extends StatelessWidget {
5
5
6
6
@override
7
7
Widget build (BuildContext context) {
8
- return Scaffold (
9
- body: Center (
10
- child: Text ('Home' ),
11
- ),
8
+ return Center (
9
+ child: Text ('Home' ),
12
10
);
13
11
}
14
12
}
Original file line number Diff line number Diff line change @@ -13,11 +13,16 @@ class LoginViewModel extends BaseModel {
13
13
final DialogService _dialogService = locator <DialogService >();
14
14
final NavigationService _navigationService = locator <NavigationService >();
15
15
16
- Future login ({@required String email, @required String password}) async {
16
+ Future login ({
17
+ @required String email,
18
+ @required String password,
19
+ }) async {
17
20
setBusy (true );
18
21
19
22
var result = await _authenticationService.loginWithEmail (
20
- email: email, password: password);
23
+ email: email,
24
+ password: password,
25
+ );
21
26
22
27
setBusy (false );
23
28
@@ -27,7 +32,7 @@ class LoginViewModel extends BaseModel {
27
32
} else {
28
33
await _dialogService.showDialog (
29
34
title: 'Login Failure' ,
30
- description: 'Couldn \' t login at this moment . Please try again later' ,
35
+ description: 'General login failure . Please try again later' ,
31
36
);
32
37
}
33
38
} else {
Original file line number Diff line number Diff line change @@ -13,11 +13,16 @@ class SignUpViewModel extends BaseModel {
13
13
final DialogService _dialogService = locator <DialogService >();
14
14
final NavigationService _navigationService = locator <NavigationService >();
15
15
16
- Future signUp ({@required String email, @required String password}) async {
16
+ Future signUp ({
17
+ @required String email,
18
+ @required String password,
19
+ }) async {
17
20
setBusy (true );
18
21
19
22
var result = await _authenticationService.signUpWithEmail (
20
- email: email, password: password);
23
+ email: email,
24
+ password: password,
25
+ );
21
26
22
27
setBusy (false );
23
28
Original file line number Diff line number Diff line change @@ -70,35 +70,35 @@ packages:
70
70
name: firebase
71
71
url: "https://pub.dartlang.org"
72
72
source: hosted
73
- version: "7.1 .0"
73
+ version: "7.2 .0"
74
74
firebase_auth:
75
75
dependency: "direct main"
76
76
description:
77
77
name: firebase_auth
78
78
url: "https://pub.dartlang.org"
79
79
source: hosted
80
- version: "0.15.3"
80
+ version: "0.15.3+1 "
81
81
firebase_auth_platform_interface:
82
82
dependency: transitive
83
83
description:
84
84
name: firebase_auth_platform_interface
85
85
url: "https://pub.dartlang.org"
86
86
source: hosted
87
- version: "1.1.3 "
87
+ version: "1.1.5 "
88
88
firebase_auth_web:
89
89
dependency: transitive
90
90
description:
91
91
name: firebase_auth_web
92
92
url: "https://pub.dartlang.org"
93
93
source: hosted
94
- version: "0.1.1+1 "
94
+ version: "0.1.1+2 "
95
95
firebase_core:
96
96
dependency: transitive
97
97
description:
98
98
name: firebase_core
99
99
url: "https://pub.dartlang.org"
100
100
source: hosted
101
- version: "0.4.3+1 "
101
+ version: "0.4.3+2 "
102
102
firebase_core_platform_interface:
103
103
dependency: transitive
104
104
description:
@@ -112,7 +112,7 @@ packages:
112
112
name: firebase_core_web
113
113
url: "https://pub.dartlang.org"
114
114
source: hosted
115
- version: "0.1.1+1 "
115
+ version: "0.1.1+2 "
116
116
flutter:
117
117
dependency: "direct main"
118
118
description: flutter
@@ -288,5 +288,5 @@ packages:
288
288
source: hosted
289
289
version: "3.5.0"
290
290
sdks:
291
- dart: ">=2.4.0 <3.0.0"
291
+ dart: ">=2.7.0-dev <3.0.0"
292
292
flutter: ">=1.12.13+hotfix.4 <2.0.0"
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ environment:
19
19
dependencies :
20
20
flutter :
21
21
sdk : flutter
22
-
23
22
# The following adds the Cupertino Icons font to your application.
24
23
# Use with the CupertinoIcons class for iOS style icons.
25
24
cupertino_icons : ^0.1.2
You can’t perform that action at this time.
0 commit comments