Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-035-CoviDefender
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-035
2021-035-CoviDefender
Commits
a8dd8153
Commit
a8dd8153
authored
Aug 22, 2021
by
Piyumi Dayarathna
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Navigations fixed
parent
4745d41d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
47 deletions
+53
-47
lib/AuthConfigs/StartScreen.dart
lib/AuthConfigs/StartScreen.dart
+15
-9
lib/STracker/finalOverallResultsPage.dart
lib/STracker/finalOverallResultsPage.dart
+2
-1
lib/home_screen.dart
lib/home_screen.dart
+26
-29
lib/mainRegisterPage.dart
lib/mainRegisterPage.dart
+10
-8
No files found.
lib/AuthConfigs/StartScreen.dart
View file @
a8dd8153
...
...
@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter_signin_button/flutter_signin_button.dart'
;
import
'../mainRegisterPage.dart'
;
import
'login.dart'
;
class
Start
extends
StatefulWidget
{
...
...
@@ -17,7 +18,6 @@ class _StartState extends State<Start> {
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
SingleChildScrollView
(
child:
Container
(
color:
Colors
.
white
,
...
...
@@ -55,7 +55,9 @@ class _StartState extends State<Start> {
"Your Personal Defender Against COVID"
,
style:
TextStyle
(
color:
Colors
.
black54
),
),
SizedBox
(
height:
20
,),
SizedBox
(
height:
20
,
),
Column
(
children:
[
SizedBox
(
...
...
@@ -63,11 +65,9 @@ class _StartState extends State<Start> {
width:
300
,
child:
RaisedButton
(
onPressed:
()
{
// go to login page
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Login
()));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Login
()));
},
child:
Text
(
"SIGN IN"
,
style:
TextStyle
(
...
...
@@ -84,7 +84,9 @@ class _StartState extends State<Start> {
// "Dont have an account yet ?",
// style: TextStyle(color: Colors.black54),
// ),
SizedBox
(
height:
15
,),
SizedBox
(
height:
15
,
),
SizedBox
(
height:
60
,
width:
300
,
...
...
@@ -92,7 +94,9 @@ class _StartState extends State<Start> {
onPressed:
()
{
// go to Register page
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Register
()));
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
mainRegisterPage
()));
},
child:
Text
(
"Register Now"
,
style:
TextStyle
(
...
...
@@ -105,7 +109,9 @@ class _StartState extends State<Start> {
color:
Colors
.
lightBlue
,
),
),
SizedBox
(
height:
30
,),
SizedBox
(
height:
30
,
),
SizedBox
(
height:
60
,
width:
300
,
...
...
lib/STracker/finalOverallResultsPage.dart
View file @
a8dd8153
import
'package:covidefender/AuthConfigs/Register.dart'
;
import
'package:covidefender/STracker/HandWashing/quizpage.dart'
;
import
'package:covidefender/STracker/levelsDashboard.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -181,7 +182,7 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
borderRadius:
BorderRadius
.
circular
(
20.0
)),
onPressed:
()
{
Navigator
.
of
(
context
).
pushReplacement
(
MaterialPageRoute
(
builder:
(
context
)
=>
levelsDashboard
(),
builder:
(
context
)
=>
Register
(),
));
},
child:
Text
(
...
...
lib/home_screen.dart
View file @
a8dd8153
...
...
@@ -10,8 +10,6 @@ import 'AuthConfigs/StartScreen.dart';
class
HomeScreen
extends
StatefulWidget
{
_HomeScreenState
createState
()
=>
_HomeScreenState
();
}
class
_HomeScreenState
extends
State
<
HomeScreen
>
{
...
...
@@ -21,7 +19,7 @@ class _HomeScreenState extends State<HomeScreen> {
@override
void
initState
()
{
this
.
checkAuthentification
();
//check every time in homescreen
this
.
checkAuthentification
();
//check every time in homescreen
this
.
getUser
();
}
...
...
@@ -38,11 +36,12 @@ class _HomeScreenState extends State<HomeScreen> {
}
});
}
// if user already logged in
getUser
()
async
{
print
(
"***********Get User Running**********"
);
FirebaseUser
firebaseuser
=
await
_auth
.
currentUser
();
// get current user from firebase
await
_auth
.
currentUser
();
// get current user from firebase
await
firebaseuser
?.
reload
();
firebaseuser
=
await
_auth
.
currentUser
();
...
...
@@ -54,12 +53,10 @@ class _HomeScreenState extends State<HomeScreen> {
}
}
signOut
()
async
{
signOut
()
async
{
_auth
.
signOut
();
}
Widget
build
(
BuildContext
context
)
{
var
size
=
MediaQuery
.
of
(
context
).
size
;
return
Scaffold
(
...
...
@@ -97,7 +94,8 @@ class _HomeScreenState extends State<HomeScreen> {
CircleAvatar
(
radius:
55
,
backgroundColor:
Colors
.
transparent
,
backgroundImage:
AssetImage
(
'lib/assets/images/cdlogo2.png'
),
backgroundImage:
AssetImage
(
'lib/assets/images/cdlogo2.png'
),
),
SizedBox
(
width:
16
,
...
...
@@ -130,13 +128,13 @@ class _HomeScreenState extends State<HomeScreen> {
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
FlatButton
(
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
loginPage
()),
);
},
//
onPressed: () {
//
Navigator.push(
//
context,
//
MaterialPageRoute(
//
builder: (context) => loginPage()),
//
);
//
},
child:
Image
.
asset
(
'lib/assets/images/man80.png'
),
),
...
...
@@ -217,14 +215,14 @@ class _HomeScreenState extends State<HomeScreen> {
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
FlatButton
(
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
splashscreen
()),
);
},
//
onPressed: () {
//
Navigator.push(
//
context,
//
MaterialPageRoute(
//
builder: (context) =>
//
splashscreen()),
//
);
//
},
child:
Image
.
asset
(
'lib/assets/images/time80.png'
),
),
...
...
@@ -267,15 +265,15 @@ class _HomeScreenState extends State<HomeScreen> {
height:
60
,
width:
300
,
child:
RaisedButton
(
onPressed:
(){
onPressed:
()
{
print
(
"***********Sign out clicked**********"
);
signOut
().
whenComplete
(()
=>
Navigator
.
of
(
context
)
.
pushAndRemoveUntil
(
MaterialPageRoute
(
builder:
(
context
)
=>
Start
()),(
Route
<
dynamic
>
route
)
=>
false
));
MaterialPageRoute
(
builder:
(
context
)
=>
Start
()),
(
Route
<
dynamic
>
route
)
=>
false
));
},
child:
Text
(
"Sign Out"
,
style:
TextStyle
(
fontSize:
20.0
,
...
...
@@ -285,8 +283,7 @@ class _HomeScreenState extends State<HomeScreen> {
borderRadius:
BorderRadius
.
circular
(
10
),
),
color:
Colors
.
lightBlue
,
)
),
)),
)
],
),
...
...
lib/mainRegisterPage.dart
View file @
a8dd8153
...
...
@@ -80,7 +80,7 @@ class _mainRegisterPageState extends State<mainRegisterPage> {
body:
Column
(
children:
<
Widget
>[
Expanded
(
flex:
1
,
flex:
2
,
child:
ButtonTheme
(
minWidth:
800.0
,
height:
100.0
,
...
...
@@ -89,7 +89,7 @@ class _mainRegisterPageState extends State<mainRegisterPage> {
onPressed:
()
{},
child:
Text
(
"Registration"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
3
0
),
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
2
0
),
),
),
)),
...
...
@@ -101,7 +101,7 @@ class _mainRegisterPageState extends State<mainRegisterPage> {
),
),
Expanded
(
flex:
5
,
flex:
6
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
...
...
@@ -130,9 +130,10 @@ class _mainRegisterPageState extends State<mainRegisterPage> {
),
child:
Center
(
child:
Text
(
"You have to answer a quiz before register
\n
Press Start Quiz to navigate."
,
"You have to answer a quiz before register.
\n
\n
Press Start Quiz to navigate."
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
3
0.0
,
fontSize:
2
0.0
,
fontWeight:
FontWeight
.
w900
,
),
),
...
...
@@ -153,13 +154,14 @@ class _mainRegisterPageState extends State<mainRegisterPage> {
},
child:
Text
(
"Start Quiz"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
3
0.0
,
fontSize:
2
0.0
,
),
),
padding:
EdgeInsets
.
symmetric
(
vertical:
2
0.0
,
horizontal:
20
0.0
,
vertical:
1
0.0
,
horizontal:
8
0.0
,
),
)
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment