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
c0f97a17
Commit
c0f97a17
authored
Jul 03, 2021
by
Indika NK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding latest changes of Iguider_phase_02
parent
15008cc1
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
605 additions
and
152 deletions
+605
-152
lib/I_GUIDER/i_guider.dart
lib/I_GUIDER/i_guider.dart
+164
-118
lib/assets/images/hospital.gif
lib/assets/images/hospital.gif
+0
-0
lib/pages/heart_rate/heart_rate_screen.dart
lib/pages/heart_rate/heart_rate_screen.dart
+34
-17
lib/pages/mask_detect/invoker.dart
lib/pages/mask_detect/invoker.dart
+34
-17
lib/pages/self_carer/SC_medicalSupport.dart
lib/pages/self_carer/SC_medicalSupport.dart
+76
-0
lib/pages/self_carer/SC_result_screen.dart
lib/pages/self_carer/SC_result_screen.dart
+74
-0
lib/pages/self_carer/model/MessageSender.dart
lib/pages/self_carer/model/MessageSender.dart
+36
-0
lib/pages/self_carer/model/Symptoms.dart
lib/pages/self_carer/model/Symptoms.dart
+12
-0
lib/pages/self_carer/model/colors.dart
lib/pages/self_carer/model/colors.dart
+38
-0
lib/pages/self_carer/sc_main_screen.dart
lib/pages/self_carer/sc_main_screen.dart
+134
-0
pubspec.yaml
pubspec.yaml
+3
-0
No files found.
lib/I_GUIDER/i_guider.dart
View file @
c0f97a17
import
'package:covidefender/pages/heart_rate/heart_rate_screen.dart'
;
import
'package:covidefender/pages/heart_rate/heart_rate_screen.dart'
;
import
'package:covidefender/pages/mask_detect/invoker.dart'
;
import
'package:covidefender/pages/mask_detect/invoker.dart'
;
import
'package:covidefender/pages/self_carer/sc_main_screen.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
class
I_guider
extends
StatelessWidget
{
class
I_guider
extends
StatelessWidget
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
mesure
=
MediaQuery
.
of
(
context
);
return
Scaffold
(
return
Scaffold
(
backgroundColor:
Colors
.
grey
[
200
]
,
backgroundColor:
Colors
.
white
,
appBar:
AppBar
(
appBar:
AppBar
(
centerTitle:
true
,
title:
Text
(
'I-Guider'
),
title:
Text
(
'I-Guider'
),
// elevation: 0,
// elevation: 0,
),
),
body:
Column
(
body:
SingleChildScrollView
(
children:
[
child:
Column
(
Row
(
children:
[
children:
[
Row
(
Expanded
(
children:
[
child:
Container
(
Expanded
(
decoration:
BoxDecoration
(
child:
Container
(
image:
DecorationImage
(
height:
mesure
.
size
.
height
/
3
,
image:
AssetImage
(
'lib/assets/images/hero.gif'
),
decoration:
BoxDecoration
(
fit:
BoxFit
.
cover
)),
image:
DecorationImage
(
height:
300
,
image:
AssetImage
(
'lib/assets/images/hero.gif'
),
fit:
BoxFit
.
cover
)),
),
),
),
),
],
],
),
),
//------------------------------------
//------------------------------------
SizedBox
(
SizedBox
(
height:
50
,
height:
50
,
),
),
Row
(
Row
(
children:
[
children:
[
Expanded
(
Expanded
(
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
0
,
8
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
0
,
8
,
0
),
child:
ButtonTheme
(
child:
ButtonTheme
(
minWidth:
100.0
,
splashColor:
Colors
.
blue
,
height:
150.0
,
minWidth:
100.0
,
child:
RaisedButton
.
icon
(
height:
150.0
,
icon:
Icon
(
child:
RaisedButton
.
icon
(
Icons
.
bluetooth_audio_rounded
,
icon:
Column
(
size:
40
,
children:
[
color:
Colors
.
white
,
Icon
(
Icons
.
bluetooth_audio_rounded
,
size:
40
,
color:
Colors
.
white
,
),
SizedBox
(
height:
20
),
Text
(
"BT Distancer"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
)
,)
],
),
label:
Text
(
''
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
)),
onPressed:
()
{},
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
)),
color:
Colors
.
blue
[
200
],
),
),
label:
Text
(
''
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
)),
onPressed:
()
{},
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
)),
color:
Colors
.
blue
[
200
],
),
),
),
),
),
),
),
Expanded
(
Expanded
(
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
0
,
8
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
0
,
8
,
0
),
child:
ButtonTheme
(
child:
ButtonTheme
(
minWidth:
100.0
,
minWidth:
100.0
,
height:
150.0
,
height:
150.0
,
child:
RaisedButton
.
icon
(
child:
RaisedButton
.
icon
(
color:
Colors
.
greenAccent
,
color:
Colors
.
greenAccent
,
icon:
Column
(
icon:
Icon
(
children:
[
Icons
.
face_unlock_sharp
,
Icon
(
size:
60
,
Icons
.
face_unlock_sharp
,
color:
Colors
.
white
,
size:
60
,
),
color:
Colors
.
white
,
label:
Text
(
),
''
,
SizedBox
(
height:
20
),
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
),
Text
(
"Mask Detector"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
)
,)
],
),
label:
Text
(
''
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
),
),
onPressed:
()
{
print
(
'face mask detection'
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
invoker
())
);
// Navigator.pushNamed(context, '/invoker');
},
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
)),
),
),
onPressed:
()
{
print
(
'face mask detection'
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
invoker
())
);
// Navigator.pushNamed(context, '/invoker');
},
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
)),
),
),
),
),
),
)
)
],
],
),
),
SizedBox
(
height:
30
),
SizedBox
(
height:
30
),
Row
(
Row
(
children:
[
children:
[
Expanded
(
Expanded
(
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
0
,
8
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
0
,
8
,
0
),
child:
ButtonTheme
(
child:
ButtonTheme
(
minWidth:
100.0
,
minWidth:
100.0
,
height:
150.0
,
height:
150.0
,
child:
RaisedButton
.
icon
(
child:
RaisedButton
.
icon
(
icon:
Column
(
icon:
Icon
(
children:
[
Icons
.
view_stream_outlined
,
Icon
(
size:
40
,
Icons
.
view_stream_outlined
,
color:
Colors
.
white
,
size:
40
,
color:
Colors
.
white
,
),
SizedBox
(
height:
20
),
Text
(
"Heart Monitor"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
)
,)
],
),
label:
Text
(
''
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
)),
onPressed:
()
{
// action when button is pressed route to heart rate measurer
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
HeartRateScreen
()
));
},
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
)),
color:
Colors
.
redAccent
,
),
),
label:
Text
(
''
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
)),
onPressed:
()
{
// action when button is pressed route to heart rate measurer
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
HeartRateScreen
()
));
},
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
)),
color:
Colors
.
redAccent
,
),
),
),
),
),
),
),
Expanded
(
Expanded
(
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
0
,
8
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
0
,
8
,
0
),
child:
ButtonTheme
(
child:
ButtonTheme
(
minWidth:
100.0
,
minWidth:
100.0
,
height:
150.0
,
height:
150.0
,
child:
RaisedButton
.
icon
(
child:
RaisedButton
.
icon
(
color:
Colors
.
purple
[
200
],
color:
Colors
.
purple
[
200
],
icon:
Column
(
icon:
Icon
(
children:
[
Icons
.
online_prediction_sharp
,
Icon
(
size:
60
,
Icons
.
online_prediction_sharp
,
color:
Colors
.
white
,
size:
60
,
),
color:
Colors
.
white
,
label:
Text
(
),
''
,
SizedBox
(
height:
20
),
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
),
Text
(
"Self-Carer"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
)
,)
],
),
label:
Text
(
''
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
),
),
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
SC_main
()));
},
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
)),
),
),
onPressed:
()
{},
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
)),
),
),
),
),
)
,
)
)
],
]
,
)
,
)
,
]
,
]
,
)
,
),
),
);
);
}
}
...
...
lib/assets/images/hospital.gif
0 → 100644
View file @
c0f97a17
459 KB
lib/pages/heart_rate/heart_rate_screen.dart
View file @
c0f97a17
...
@@ -9,23 +9,40 @@ class HeartRateScreen extends StatelessWidget {
...
@@ -9,23 +9,40 @@ class HeartRateScreen extends StatelessWidget {
appBar:
AppBar
(
appBar:
AppBar
(
title:
Text
(
'Heart Rate Detector'
),
title:
Text
(
'Heart Rate Detector'
),
),
),
body:
Column
(
body:
Container
(
children:
[
color:
Colors
.
white
,
Padding
(
child:
Column
(
padding:
const
EdgeInsets
.
all
(
8.0
),
children:
[
child:
Image
.
asset
(
'lib/assets/images/pulse.gif'
),
Padding
(
),
padding:
const
EdgeInsets
.
all
(
8.0
),
SizedBox
(
height:
20
),
child:
Image
.
asset
(
'lib/assets/images/pulse.gif'
),
Column
(
),
crossAxisAlignment:
CrossAxisAlignment
.
start
,
SizedBox
(
height:
20
),
children:
[
Column
(
ElevatedButton
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
onPressed:
()
=>
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
HomePage
(),)),
children:
[
child:
Text
(
'Measure Heart Rate'
),
Padding
(
),
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
70
,
8
,
8
),
],
child:
SizedBox
(
),
height:
70
,
],
width:
350
,
child:
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
primary:
Colors
.
red
[
300
],
elevation:
15
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
12
)
)
),
onPressed:
()
=>
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
HomePage
(),)),
child:
Text
(
'Measure Heart Rate'
),
),
),
),
],
),
],
),
),
),
);
);
}
}
...
...
lib/pages/mask_detect/invoker.dart
View file @
c0f97a17
...
@@ -11,23 +11,40 @@ class invoker extends StatelessWidget {
...
@@ -11,23 +11,40 @@ class invoker extends StatelessWidget {
appBar:
AppBar
(
appBar:
AppBar
(
title:
Text
(
'Face Mask Detector'
),
title:
Text
(
'Face Mask Detector'
),
),
),
body:
Column
(
body:
Container
(
children:
[
color:
Colors
.
white
,
Padding
(
child:
Column
(
padding:
const
EdgeInsets
.
all
(
8.0
),
children:
[
child:
Image
.
asset
(
'lib/assets/images/wear.gif'
),
Padding
(
),
padding:
const
EdgeInsets
.
all
(
8.0
),
SizedBox
(
height:
20
),
child:
Image
.
asset
(
'lib/assets/images/wear.gif'
),
Column
(
),
crossAxisAlignment:
CrossAxisAlignment
.
start
,
SizedBox
(
height:
20
),
children:
[
Column
(
ElevatedButton
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
onPressed:
()
=>
invokeCamera
(),
children:
[
child:
Text
(
'Detect Mask'
),
Padding
(
),
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
70
,
8
,
8
),
],
child:
SizedBox
(
),
height:
70
,
],
width:
350
,
child:
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
primary:
Colors
.
blue
[
300
],
elevation:
15
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
12
)
)
),
onPressed:
()
=>
invokeCamera
(),
child:
Text
(
'Detect Mask'
),
),
),
),
],
),
],
),
),
),
);
);
}
}
...
...
lib/pages/self_carer/SC_medicalSupport.dart
0 → 100644
View file @
c0f97a17
import
'package:covidefender/pages/self_carer/model/MessageSender.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
class
SC_medicalResult
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
'Results'
),
),
body:
SingleChildScrollView
(
child:
Container
(
color:
Colors
.
white
,
child:
Column
(
children:
[
Center
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
2.5
,
child:
Image
.
asset
(
'lib/assets/images/lab.gif'
)),
),
SizedBox
(
height:
10
,
),
Padding
(
padding:
const
EdgeInsets
.
all
(
16.0
),
child:
Text
(
"Request Medical Officer Support"
,
style:
GoogleFonts
.
lato
(
color:
Colors
.
green
,
fontSize:
24
,
fontWeight:
FontWeight
.
bold
,
letterSpacing:
2
)),
),
SizedBox
(
height:
10
,
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
20
,
50
,
50
,
10
),
child:
Text
(
"I agree To send My Details and location to Medical Officer "
,
style:
GoogleFonts
.
adamina
(
color:
Colors
.
blue
,
fontSize:
16
,
fontStyle:
FontStyle
.
italic
,
wordSpacing:
2
),
),
),
SizedBox
(
height:
60
,
),
SizedBox
(
height:
70
,
width:
350
,
child:
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
primary:
Colors
.
red
[
300
],
elevation:
15
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
12
)
)
),
onPressed:
()
{
MessageSender
m
=
new
MessageSender
();
m
.
SENDSMS
();
},
child:
Text
(
'SEND SMS'
,
style:
GoogleFonts
.
lato
(
fontWeight:
FontWeight
.
bold
,
fontSize:
16
),)),
)
],
),
),
),
);
}
}
lib/pages/self_carer/SC_result_screen.dart
0 → 100644
View file @
c0f97a17
import
'package:covidefender/pages/self_carer/SC_medicalSupport.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
class
SC_resultScreen
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
'Results'
),
),
body:
SingleChildScrollView
(
child:
Container
(
color:
Colors
.
white
,
child:
Column
(
children:
[
Center
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
2.5
,
child:
Image
.
asset
(
'lib/assets/images/lab.gif'
)),
),
SizedBox
(
height:
10
,
),
Text
(
"Analysis Results"
,
style:
GoogleFonts
.
lato
(
color:
Colors
.
blue
,
fontSize:
24
,
fontWeight:
FontWeight
.
bold
,
letterSpacing:
2
)),
SizedBox
(
height:
10
,
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
20
,
50
,
50
,
10
),
child:
Text
(
"Seem's you are having Symptoms Related to Covid19.
\n
"
"Let's Get Medical Assistance !
\n
"
"Click Below Button To Get a Health Officer"
,
style:
GoogleFonts
.
adamina
(
color:
Colors
.
red
,
fontSize:
16
,
fontStyle:
FontStyle
.
italic
,
wordSpacing:
2
),
),
),
SizedBox
(
height:
60
,
),
SizedBox
(
height:
70
,
width:
350
,
child:
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
primary:
Colors
.
red
[
300
],
elevation:
15
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
12
)
)
),
onPressed:
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)=>
SC_medicalResult
()));
},
child:
Text
(
'Medical Support'
,
style:
GoogleFonts
.
lato
(
fontWeight:
FontWeight
.
bold
,
fontSize:
16
),)),
)
],
),
),
),
);
}
}
lib/pages/self_carer/model/MessageSender.dart
0 → 100644
View file @
c0f97a17
import
'dart:collection'
;
import
'package:flutter_sms/flutter_sms.dart'
;
class
MessageSender
{
List
<
String
>
recipients
=
[
"+94776957629"
];
Map
<
String
,
String
>
myDetails
=
{
"Name"
:
"Indika Nuwan"
,
"Address"
:
"02 nd post ,Mawanella"
,
"HomePhone"
:
"03522444555"
,
"message"
:
"This Patient Need Imediate assistance"
};
// MessageSender(this.recipients, this.message);
void
SENDSMS
()
async
{
print
(
myDetails
.
toString
());
String
result
=
await
sendSMS
(
message:
myDetails
.
toString
(),
recipients:
recipients
).
catchError
((
onError
)=>
print
(
onError
));
print
(
"result"
);
}
void
SetData
(
){
}
}
lib/pages/self_carer/model/Symptoms.dart
0 → 100644
View file @
c0f97a17
import
'dart:ui'
;
class
Symptoms
{
String
symptomname
;
bool
value
;
List
<
Color
>
gradientColors
;
Symptoms
(
this
.
symptomname
,
this
.
value
,{
this
.
gradientColors
});
@override
String
toString
()
{
return
'Symptoms{symptomname:
$symptomname
, value:
$value
}'
;
}
}
\ No newline at end of file
lib/pages/self_carer/model/colors.dart
0 → 100644
View file @
c0f97a17
import
'package:flutter/material.dart'
;
class
CustomColors
{
static
Color
primaryTextColor
=
Colors
.
white
;
static
Color
dividerColor
=
Colors
.
white54
;
static
Color
pageBackgroundColor
=
Color
(
0xFF2D2F41
);
static
Color
menuBackgroundColor
=
Color
(
0xFF242634
);
static
Color
clockBG
=
Color
(
0xFF444974
);
static
Color
clockOutline
=
Color
(
0xFFEAECFF
);
static
Color
secHandColor
=
Colors
.
orange
[
300
];
static
Color
minHandStatColor
=
Color
(
0xFF748EF6
);
static
Color
minHandEndColor
=
Color
(
0xFF77DDFF
);
static
Color
hourHandStatColor
=
Color
(
0xFFC279FB
);
static
Color
hourHandEndColor
=
Color
(
0xFFEA74AB
);
}
class
GradientColors
{
final
List
<
Color
>
colors
;
GradientColors
(
this
.
colors
);
static
List
<
Color
>
sky
=
[
Color
(
0xFF6448FE
),
Color
(
0xFF5FC6FF
)];
static
List
<
Color
>
sunset
=
[
Color
(
0xFFFE6197
),
Color
(
0xFFFFB463
)];
static
List
<
Color
>
sea
=
[
Color
(
0xFF61A3FE
),
Color
(
0xFF63FFD5
)];
static
List
<
Color
>
mango
=
[
Color
(
0xFFFFA738
),
Color
(
0xFFFFE130
)];
static
List
<
Color
>
fire
=
[
Color
(
0xFFFF5DCD
),
Color
(
0xFFFF8484
)];
}
class
GradientTemplate
{
static
List
<
GradientColors
>
gradientTemplate
=
[
GradientColors
(
GradientColors
.
sky
),
GradientColors
(
GradientColors
.
sunset
),
GradientColors
(
GradientColors
.
sea
),
GradientColors
(
GradientColors
.
mango
),
GradientColors
(
GradientColors
.
fire
),
];
}
lib/pages/self_carer/sc_main_screen.dart
0 → 100644
View file @
c0f97a17
import
'dart:collection'
;
import
'package:covidefender/pages/self_carer/SC_result_screen.dart'
;
import
'package:covidefender/pages/self_carer/model/colors.dart'
;
import
'package:flutter/material.dart'
;
import
'package:quiver/collection.dart'
;
import
'model/Symptoms.dart'
;
class
SC_main
extends
StatefulWidget
{
@override
SC_mainState
createState
()
=>
SC_mainState
();
}
class
SC_mainState
extends
State
<
SC_main
>
{
bool
isPositiveMatch
=
false
;
// String symptom = "i am a symptom";
// HashMap symptomMap = new HashMap<int,String>();
Map
<
String
,
bool
>
symptomList
=
HashMap
();
Map
<
String
,
bool
>
values
=
{
'Fever With Chills'
:
false
,
'Cough and Sneezing'
:
false
,
'Difficulty in Breathing'
:
false
,
'Sore throat / Blush lips'
:
false
,
'Mustle Pain or Ache'
:
false
,
};
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
"Self-Carer"
),
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
2.5
,
child:
Image
.
asset
(
'lib/assets/images/hospital.gif'
,
)),
SizedBox
(
height:
350
,
child:
new
ListView
(
children:
values
.
keys
.
map
((
String
key
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
20
,
left:
10
,
right:
10
),
decoration:
BoxDecoration
(
boxShadow:
[
BoxShadow
(
color:
Colors
.
blue
.
withOpacity
(
0.4
)
,
blurRadius:
8
,
offset:
Offset
(
4
,
4
),
spreadRadius:
4
)
],
gradient:
LinearGradient
(
colors:
[
Colors
.
blue
[
600
],
Colors
.
white
],
begin:
Alignment
.
centerLeft
,
end:
Alignment
.
centerRight
,
),
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
24
)),
),
child:
SizedBox
(
height:
90
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
new
CheckboxListTile
(
title:
new
Text
(
key
,
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
'avenir'
,
),),
value:
values
[
key
],
onChanged:
(
bool
value
)
{
setState
(()
{
values
[
key
]
=
value
;
symptomList
.
clear
();
values
.
forEach
((
key
,
value
)
{
print
(
'
${key}
:
${value}
'
);
if
(
value
)
{
symptomList
.
putIfAbsent
(
key
,
()
=>
value
);
print
(
'Selected Items::'
+
symptomList
.
toString
());
}
});
});
print
(
key
);
},
),
),
),
);
}).
toList
(),
),
),
],
),
),
),
floatingActionButton:
FloatingActionButton
(
onPressed:
()
=>
{
if
(
symptomList
.
isEmpty
)
{
print
(
"Please select your Symptoms"
)}
else
{
if
(
symptomList
.
containsKey
(
'Fever With Chills'
)
&&
symptomList
.
containsKey
(
'Cough and Sneezing'
)
&&
symptomList
.
containsKey
(
'Difficulty in Breathing'
)
&&
symptomList
.
containsKey
(
'Sore throat / Blush lips'
)
&&
symptomList
.
containsKey
(
'Mustle Pain or Ache'
)){
print
(
"Positive Match Found Immediate Treatements needed !"
),
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
SC_resultScreen
()))
}
}
},
child:
Icon
(
// Icons.next_plan_outlined
Icons
.
double_arrow_rounded
)),
);
}
}
pubspec.yaml
View file @
c0f97a17
...
@@ -33,6 +33,8 @@ dependencies:
...
@@ -33,6 +33,8 @@ dependencies:
wakelock
:
^0.1.4+1
wakelock
:
^0.1.4+1
charts_flutter
:
^0.9.0
charts_flutter
:
^0.9.0
flutter_spinkit
:
"
^4.1.2"
flutter_spinkit
:
"
^4.1.2"
google_fonts
:
^1.1.2
flutter_sms
:
^2.1.1
...
@@ -121,6 +123,7 @@ flutter:
...
@@ -121,6 +123,7 @@ flutter:
-
lib/assets/labels.txt
-
lib/assets/labels.txt
-
assets/
-
assets/
-
lib/assets/images/wear.gif
-
lib/assets/images/wear.gif
-
lib/assets/images/hospital.gif
# To add assets to your application, add an assets section, like this:
# To add assets to your application, add an assets section, like this:
# assets:
# assets:
...
...
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