Skip to content

Commit 95d4666

Browse files
author
PeterHdd
committed
chore: update version
1 parent 7de26e9 commit 95d4666

File tree

6 files changed

+46
-38
lines changed

6 files changed

+46
-38
lines changed

firebase_authentication_tutorial/lib/email_login.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class _EmailLogInState extends State<EmailLogIn> {
3535
),
3636
// The validator receives the text that the user has entered.
3737
validator: (value) {
38-
if (value.isEmpty) {
38+
if (value!.isEmpty) {
3939
return 'Enter Email Address';
4040
} else if (!value.contains('@')) {
4141
return 'Please enter a valid email address!';
@@ -57,7 +57,7 @@ class _EmailLogInState extends State<EmailLogIn> {
5757
),
5858
// The validator receives the text that the user has entered.
5959
validator: (value) {
60-
if (value.isEmpty) {
60+
if (value!.isEmpty) {
6161
return 'Enter Password';
6262
} else if (value.length < 6) {
6363
return 'Password must be atleast 6 characters!';
@@ -73,7 +73,7 @@ class _EmailLogInState extends State<EmailLogIn> {
7373
: ElevatedButton(
7474
style: ButtonStyle(backgroundColor: MaterialStateProperty.all<Color>(Colors.lightBlue)),
7575
onPressed: () {
76-
if (_formKey.currentState.validate()) {
76+
if (_formKey.currentState!.validate()) {
7777
setState(() {
7878
isLoading = true;
7979
});
@@ -94,7 +94,7 @@ class _EmailLogInState extends State<EmailLogIn> {
9494
isLoading = false;
9595
Navigator.pushReplacement(
9696
context,
97-
MaterialPageRoute(builder: (context) => Home(uid: result.user.uid)),
97+
MaterialPageRoute(builder: (context) => Home(uid: result.user!.uid)),
9898
);
9999
}).catchError((err) {
100100
print(err.message);

firebase_authentication_tutorial/lib/email_signup.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
4040
),
4141
// The validator receives the text that the user has entered.
4242
validator: (value) {
43-
if (value.isEmpty) {
43+
if (value!.isEmpty) {
4444
return 'Enter User Name';
4545
}
4646
return null;
@@ -59,7 +59,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
5959
),
6060
// The validator receives the text that the user has entered.
6161
validator: (value) {
62-
if (value.isEmpty) {
62+
if (value!.isEmpty) {
6363
return 'Enter an Email Address';
6464
} else if (!value.contains('@')) {
6565
return 'Please enter a valid email address';
@@ -80,7 +80,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
8080
),
8181
// The validator receives the text that the user has entered.
8282
validator: (value) {
83-
if (value.isEmpty) {
83+
if (value!.isEmpty) {
8484
return 'Enter Age';
8585
}
8686
return null;
@@ -100,7 +100,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
100100
),
101101
// The validator receives the text that the user has entered.
102102
validator: (value) {
103-
if (value.isEmpty) {
103+
if (value!.isEmpty) {
104104
return 'Enter Password';
105105
} else if (value.length < 6) {
106106
return 'Password must be atleast 6 characters!';
@@ -116,7 +116,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
116116
: ElevatedButton(
117117
style: ButtonStyle(backgroundColor: MaterialStateProperty.all<Color>(Colors.lightBlue)),
118118
onPressed: () {
119-
if (_formKey.currentState.validate()) {
119+
if (_formKey.currentState!.validate()) {
120120
setState(() {
121121
isLoading = true;
122122
});
@@ -134,15 +134,15 @@ class _EmailSignUpState extends State<EmailSignUp> {
134134
.createUserWithEmailAndPassword(
135135
email: emailController.text, password: passwordController.text)
136136
.then((result) {
137-
dbRef.child(result.user.uid).set({
137+
dbRef.child(result.user!.uid).set({
138138
"email": emailController.text,
139139
"age": ageController.text,
140140
"name": nameController.text
141141
}).then((res) {
142142
isLoading = false;
143143
Navigator.pushReplacement(
144144
context,
145-
MaterialPageRoute(builder: (context) => Home(uid: result.user.uid)),
145+
MaterialPageRoute(builder: (context) => Home(uid: result.user!.uid)),
146146
);
147147
});
148148
}).catchError((err) {

firebase_authentication_tutorial/lib/home.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'signup.dart';
66

77
class Home extends StatelessWidget {
88
Home({this.uid});
9-
final String uid;
9+
final String? uid;
1010
final String title = "Home";
1111

1212
@override
@@ -38,8 +38,8 @@ class Home extends StatelessWidget {
3838
}
3939

4040
class NavigateDrawer extends StatefulWidget {
41-
final String uid;
42-
NavigateDrawer({Key key, this.uid}) : super(key: key);
41+
final String? uid;
42+
NavigateDrawer({Key? key, this.uid}) : super(key: key);
4343
@override
4444
_NavigateDrawerState createState() => _NavigateDrawerState();
4545
}
@@ -56,11 +56,11 @@ class _NavigateDrawerState extends State<NavigateDrawer> {
5656
future: FirebaseDatabase.instance
5757
.reference()
5858
.child("Users")
59-
.child(widget.uid)
59+
.child(widget.uid!)
6060
.once(),
6161
builder: (context, AsyncSnapshot<DataSnapshot> snapshot) {
6262
if (snapshot.hasData) {
63-
return Text(snapshot.data.value['email']);
63+
return Text(snapshot.data!.value['email']);
6464
} else {
6565
return CircularProgressIndicator();
6666
}
@@ -69,11 +69,11 @@ class _NavigateDrawerState extends State<NavigateDrawer> {
6969
future: FirebaseDatabase.instance
7070
.reference()
7171
.child("Users")
72-
.child(widget.uid)
72+
.child(widget.uid!)
7373
.once(),
7474
builder: (context, AsyncSnapshot<DataSnapshot> snapshot) {
7575
if (snapshot.hasData) {
76-
return Text(snapshot.data.value['name']);
76+
return Text(snapshot.data!.value['name']);
7777
} else {
7878
return CircularProgressIndicator();
7979
}

firebase_authentication_tutorial/lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ class MyApp extends StatelessWidget {
2929
class IntroScreen extends StatelessWidget {
3030
@override
3131
Widget build(BuildContext context) {
32-
User result = FirebaseAuth.instance.currentUser;
32+
User? result = FirebaseAuth.instance.currentUser;
3333
return new SplashScreen(
34+
useLoader: true,
35+
loadingTextPadding: EdgeInsets.all(0),
36+
loadingText: Text(""),
3437
navigateAfterSeconds: result != null ? Home(uid: result.uid) : SignUp(),
3538
seconds: 5,
3639
title: new Text(

firebase_authentication_tutorial/pubspec.lock

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,49 +63,49 @@ packages:
6363
name: firebase_auth
6464
url: "https://pub.dartlang.org"
6565
source: hosted
66-
version: "1.0.3"
66+
version: "1.3.0"
6767
firebase_auth_platform_interface:
6868
dependency: transitive
6969
description:
7070
name: firebase_auth_platform_interface
7171
url: "https://pub.dartlang.org"
7272
source: hosted
73-
version: "4.0.2"
73+
version: "4.2.4"
7474
firebase_auth_web:
7575
dependency: transitive
7676
description:
7777
name: firebase_auth_web
7878
url: "https://pub.dartlang.org"
7979
source: hosted
80-
version: "1.0.5"
80+
version: "1.2.0"
8181
firebase_core:
8282
dependency: "direct main"
8383
description:
8484
name: firebase_core
8585
url: "https://pub.dartlang.org"
8686
source: hosted
87-
version: "1.0.3"
87+
version: "1.2.1"
8888
firebase_core_platform_interface:
8989
dependency: transitive
9090
description:
9191
name: firebase_core_platform_interface
9292
url: "https://pub.dartlang.org"
9393
source: hosted
94-
version: "4.0.0"
94+
version: "4.0.1"
9595
firebase_core_web:
9696
dependency: transitive
9797
description:
9898
name: firebase_core_web
9999
url: "https://pub.dartlang.org"
100100
source: hosted
101-
version: "1.0.2"
101+
version: "1.1.0"
102102
firebase_database:
103103
dependency: "direct main"
104104
description:
105105
name: firebase_database
106106
url: "https://pub.dartlang.org"
107107
source: hosted
108-
version: "6.1.2"
108+
version: "7.1.0"
109109
flutter:
110110
dependency: "direct main"
111111
description: flutter
@@ -117,7 +117,7 @@ packages:
117117
name: flutter_signin_button
118118
url: "https://pub.dartlang.org"
119119
source: hosted
120-
version: "1.0.0"
120+
version: "2.0.0"
121121
flutter_test:
122122
dependency: "direct dev"
123123
description: flutter
@@ -134,7 +134,7 @@ packages:
134134
name: font_awesome_flutter
135135
url: "https://pub.dartlang.org"
136136
source: hosted
137-
version: "8.8.1"
137+
version: "9.0.0"
138138
http_parser:
139139
dependency: transitive
140140
description:
@@ -199,10 +199,12 @@ packages:
199199
splashscreen:
200200
dependency: "direct main"
201201
description:
202-
name: splashscreen
203-
url: "https://pub.dartlang.org"
204-
source: hosted
205-
version: "1.2.0"
202+
path: "."
203+
ref: master
204+
resolved-ref: a05b64f8326f7c2615491e9f47a1f2dcf8b28a69
205+
url: "https://github.com/DPLYR-dev/SplashScreenFlutterPackage.git"
206+
source: git
207+
version: "1.4.0"
206208
stack_trace:
207209
dependency: transitive
208210
description:

firebase_authentication_tutorial/pubspec.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1818
version: 1.0.0+1
1919

2020
environment:
21-
sdk: ">=2.7.0 <3.0.0"
21+
sdk: '>=2.12.0 <3.0.0'
2222

2323
dependencies:
2424
flutter:
2525
sdk: flutter
2626
cupertino_icons: ^0.1.3
27-
firebase_auth: ^1.0.3
28-
firebase_core: ^1.0.3
29-
firebase_database: ^6.1.2
30-
flutter_signin_button: ^1.0.0
31-
splashscreen: 1.2.0
27+
firebase_auth: ^1.3.0
28+
firebase_core: ^1.2.1
29+
firebase_database: ^7.1.0
30+
flutter_signin_button: ^2.0.0
31+
splashscreen:
32+
git:
33+
url: https://github.com/DPLYR-dev/SplashScreenFlutterPackage.git
34+
ref: master
3235

3336
dev_dependencies:
3437
flutter_test:

0 commit comments

Comments
 (0)