Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Stress_detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Himali Aryal
Stress_detection
Commits
6a5dcd6f
Commit
6a5dcd6f
authored
4 years ago
by
Himali Aryal
Browse files
Options
Downloads
Patches
Plain Diff
added stress level
parent
272bd28d
No related branches found
No related tags found
1 merge request
!10
added stress level
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ui/entries/emoji_entries.dart
+23
-20
23 additions, 20 deletions
lib/ui/entries/emoji_entries.dart
with
23 additions
and
20 deletions
lib/ui/entries/emoji_entries.dart
+
23
−
20
View file @
6a5dcd6f
...
...
@@ -12,6 +12,7 @@ class Emojis extends StatefulWidget {
class
_EmojisState
extends
State
<
Emojis
>
{
String
_typeSelected
=
''
;
String
_createdAt
=
''
;
String
_level
=
''
;
DatabaseReference
_ref
;
@override
...
...
@@ -23,15 +24,17 @@ class _EmojisState extends State<Emojis> {
@override
Widget
build
(
BuildContext
context
)
{
void
saveContent
(
String
title
)
{
void
saveContent
(
String
title
,
String
level
)
{
setState
(()
{
_typeSelected
=
title
;
_level
=
level
;
_createdAt
=
DateTime
.
now
()
.
millisecondsSinceEpoch
.
toString
();
});
String
user
=
FirebaseAuth
.
instance
.
currentUser
.
uid
;
Map
<
String
,
String
>
emojis
=
{
'uid'
:
user
,
'content'
:
_typeSelected
,
'level'
:
_level
,
'Timestamp'
:
_createdAt
,
};
_ref
.
push
()
.
set
(
emojis
)
.
then
((
value
)
{
...
...
@@ -106,7 +109,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Angry'
);
saveContent
(
'Angry'
,
'2'
);
},
icon:
Image
.
asset
(
'assets/images/emoticon-angry.png'
),
),
...
...
@@ -118,7 +121,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Bored'
);
saveContent
(
'Bored'
,
'1'
);
},
icon:
Image
.
asset
(
'assets/images/emoticon-bored.png'
),
),
...
...
@@ -131,7 +134,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Very sad'
);
saveContent
(
'Very sad'
,
'3'
);
},
icon:
Image
.
asset
(
'assets/images/emoticon-very-sad.png'
),
),
...
...
@@ -142,7 +145,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Sleepy'
);
saveContent
(
'Sleepy'
,
'1'
);
},
icon:
Image
.
asset
(
'assets/images/emoticon-sleepy.png'
),
),
...
...
@@ -153,7 +156,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Tired'
);
saveContent
(
'Tired'
,
'1'
);
},
icon:
Image
.
asset
(
'assets/images/emoticon-tired.png'
),
),
...
...
@@ -164,7 +167,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Happy'
);
saveContent
(
'Happy'
,
'4'
);
},
icon:
Image
.
asset
(
'assets/images/emoticon-happy.png'
),
),
...
...
@@ -175,7 +178,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Motivated'
);
saveContent
(
'Motivated'
,
'5'
);
},
icon:
Image
.
asset
(
'assets/images/emoticon-motivated.png'
),
),
...
...
@@ -222,7 +225,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Cleaning'
);
saveContent
(
'Cleaning'
,
'1'
);
},
icon:
Image
.
asset
(
'assets/images/clean.png'
),
),
...
...
@@ -233,7 +236,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Date'
);
saveContent
(
'Date'
,
'4'
);
},
icon:
Image
.
asset
(
'assets/images/date.png'
),
),
...
...
@@ -244,7 +247,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Eat'
);
saveContent
(
'Eat'
,
'1'
);
},
icon:
Image
.
asset
(
'assets/images/eat.png'
),
),
...
...
@@ -255,7 +258,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Exercise'
);
saveContent
(
'Exercise'
,
'5'
);
},
icon:
Image
.
asset
(
'assets/images/excercise.png'
),
),
...
...
@@ -266,7 +269,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Family gathering'
);
saveContent
(
'Family gathering'
,
'5'
);
},
icon:
Image
.
asset
(
'assets/images/family.png'
),
),
...
...
@@ -277,7 +280,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Friends gathering'
);
saveContent
(
'Friends gathering'
,
'5'
);
},
icon:
Image
.
asset
(
'assets/images/friends.png'
),
),
...
...
@@ -288,7 +291,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Gaming'
);
saveContent
(
'Gaming'
,
'2'
);
},
icon:
Image
.
asset
(
'assets/images/gaming.png'
),
),
...
...
@@ -299,7 +302,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Movies'
);
saveContent
(
'Movies'
,
'1'
);
},
icon:
Image
.
asset
(
'assets/images/movies.png'
),
),
...
...
@@ -310,7 +313,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Reading'
);
saveContent
(
'Reading'
,
'4'
);
},
icon:
Image
.
asset
(
'assets/images/reading.png'
),
),
...
...
@@ -321,7 +324,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Relax'
);
saveContent
(
'Relax'
,
'5'
);
},
icon:
Image
.
asset
(
'assets/images/relax.png'
),
),
...
...
@@ -332,7 +335,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Shopping'
);
saveContent
(
'Shopping'
,
'1'
);
},
icon:
Image
.
asset
(
'assets/images/shop.png'
),
),
...
...
@@ -343,7 +346,7 @@ class _EmojisState extends State<Emojis> {
child:
IconButton
(
iconSize:
90.0
,
onPressed:
(){
saveContent
(
'Sports'
);
saveContent
(
'Sports'
,
'5'
);
},
icon:
Image
.
asset
(
'assets/images/sports.png'
),
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment