Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Monitoring and Recommendations For Early Childhood Development
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
0
Merge Requests
0
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
Sandunika Senavirathna
Monitoring and Recommendations For Early Childhood Development
Commits
45c024a8
Commit
45c024a8
authored
Mar 14, 2024
by
Uditha Prabhasha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update kidsReport.dart
parent
ae6d048c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
294 deletions
+91
-294
lib/kidsReport.dart
lib/kidsReport.dart
+91
-294
No files found.
lib/kidsReport.dart
View file @
45c024a8
...
@@ -8,309 +8,104 @@ class KidsReportPage extends StatefulWidget {
...
@@ -8,309 +8,104 @@ class KidsReportPage extends StatefulWidget {
KidsReportPage
({
required
this
.
id
});
KidsReportPage
({
required
this
.
id
});
@override
@override
_
kidsReportPageState
createState
()
=>
_k
idsReportPageState
(
id:
id
);
_
KidsReportPageState
createState
()
=>
_K
idsReportPageState
(
id:
id
);
}
}
class
_kidsReportPageState
extends
State
<
KidsReportPage
>
{
class
_KidsReportPageState
extends
State
<
KidsReportPage
>
{
// value set to false
String
id
;
bool
_valu1
=
false
;
_KidsReportPageState
({
required
this
.
id
});
bool
_valu2
=
false
;
bool
_valu3
=
false
;
List
<
String
>
dropdownValues
=
[
'1'
,
'2'
,
'3'
,
'4'
,
'5'
];
bool
_valu4
=
false
;
bool
_valu5
=
false
;
Map
<
String
,
String
?>
dropdownMap
=
{
'Understanding commands'
:
null
,
'Answer questions'
:
null
,
'Keeping eye contact.'
:
null
,
'Following rules.'
:
null
,
'Motor activities'
:
null
,
'Correct posture'
:
null
,
'Can build/create new things'
:
null
,
'Knows how to handle accessories'
:
null
,
};
final
_formkey
=
GlobalKey
<
FormState
>();
final
_formkey
=
GlobalKey
<
FormState
>();
final
_auth
=
FirebaseAuth
.
instance
;
final
_auth
=
FirebaseAuth
.
instance
;
String
id
;
_kidsReportPageState
({
required
this
.
id
});
// App widget tree
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
title:
Text
(
'Student Report
'
),
//IconButton
title:
Text
(
'Student Report
'
),
),
//AppBar
),
body:
SingleChildScrollView
(
body:
SingleChildScrollView
(
child:
Center
(
child:
Center
(
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Column
(
child:
Form
(
children:
[
key:
_formkey
,
Container
(
child:
Column
(
// decoration: BoxDecoration(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
// borderRadius: BorderRadius.circular(20),
children:
[
// boxShadow: [
Table
(
// BoxShadow(
columnWidths:
{
// color: Colors.black,
0
:
FlexColumnWidth
(
3
),
// offset: const Offset(
1
:
FlexColumnWidth
(
1
),
// 3.0,
// 3.0,
// ), //Offset
// blurRadius: 10.0,
// spreadRadius: 2.0,
// ), //BoxShadow
// BoxShadow(
// color: Colors.white,
// offset: const Offset(0.0, 0.0),
// blurRadius: 0.0,
// spreadRadius: 0.0,
// ), //BoxShadow
// ],
// ), //BoxDecoration
/** CheckboxListTile Widget **/
child:
CheckboxListTile
(
title:
const
Text
(
'Understanding'
),
subtitle:
const
Text
(
'Understanding commands, Answer questions, Keeping eye contact, Following rules.'
),
// secondary: CircleAvatar(
// backgroundImage: NetworkImage(
// "https://pbs.twimg.com/profile_images/1304985167476523008/QNHrwL2q_400x400.jpg"), //NetworkImage
// radius: 20,
// ),
autofocus:
false
,
isThreeLine:
true
,
activeColor:
Colors
.
green
,
checkColor:
Colors
.
white
,
selected:
_valu1
,
value:
_valu1
,
onChanged:
(
bool
?
value
)
{
setState
(()
{
_valu1
=
value
??
false
;
});
},
),
//CheckboxListTile
),
SizedBox
(
height:
20
),
Container
(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(20),
// boxShadow: [
// BoxShadow(
// color: Colors.black,
// offset: const Offset(
// 3.0,
// 3.0,
// ), //Offset
// blurRadius: 10.0,
// spreadRadius: 2.0,
// ), //BoxShadow
// BoxShadow(
// color: Colors.white,
// offset: const Offset(0.0, 0.0),
// blurRadius: 0.0,
// spreadRadius: 0.0,
// ), //BoxShadow
// ],
// ), //BoxDecoration
/** CheckboxListTile Widget **/
child:
CheckboxListTile
(
title:
const
Text
(
'Movements'
),
subtitle:
const
Text
(
'Motor activities, Correct posture.'
),
// secondary: CircleAvatar(
// backgroundImage: NetworkImage(
// "https://pbs.twimg.com/profile_images/1304985167476523008/QNHrwL2q_400x400.jpg"), //NetworkImage
// radius: 20,
// ),
autofocus:
false
,
isThreeLine:
true
,
activeColor:
Colors
.
green
,
checkColor:
Colors
.
white
,
selected:
_valu2
,
value:
_valu2
,
onChanged:
(
bool
?
value
)
{
setState
(()
{
_valu2
=
value
??
false
;
});
},
},
),
//CheckboxListTile
children:
dropdownMap
.
keys
.
map
((
String
key
)
{
),
return
TableRow
(
SizedBox
(
height:
20
),
children:
[
Container
(
Padding
(
// decoration: BoxDecoration(
padding:
const
EdgeInsets
.
all
(
8.0
),
// borderRadius: BorderRadius.circular(20),
child:
Text
(
key
),
// boxShadow: [
),
// BoxShadow(
Padding
(
// color: Colors.black,
padding:
const
EdgeInsets
.
all
(
8.0
),
// offset: const Offset(
child:
DropdownButtonFormField
<
String
>(
// 3.0,
value:
dropdownMap
[
key
],
// 3.0,
items:
dropdownValues
.
map
((
String
value
)
{
// ), //Offset
return
DropdownMenuItem
<
String
>(
// blurRadius: 10.0,
value:
value
,
// spreadRadius: 2.0,
child:
Text
(
value
),
// ), //BoxShadow
);
// BoxShadow(
}).
toList
(),
// color: Colors.white,
onChanged:
(
String
?
value
)
{
// offset: const Offset(0.0, 0.0),
setState
(()
{
// blurRadius: 0.0,
dropdownMap
[
key
]
=
value
;
// spreadRadius: 0.0,
});
// ), //BoxShadow
},
// ],
),
// ), //BoxDecoration
),
],
/** CheckboxListTile Widget **/
);
child:
CheckboxListTile
(
}).
toList
(),
title:
const
Text
(
'Manipulating'
),
),
subtitle:
const
Text
(
SizedBox
(
height:
20
),
'Can build/create new things, Knows how to handle accessories'
),
Row
(
// secondary: CircleAvatar(
mainAxisAlignment:
MainAxisAlignment
.
center
,
// backgroundImage: NetworkImage(
children:
[
// "https://pbs.twimg.com/profile_images/1304985167476523008/QNHrwL2q_400x400.jpg"), //NetworkImage
ElevatedButton
(
// radius: 20,
onPressed:
()
async
{
// ),
if
(
_formkey
.
currentState
!.
validate
())
{
autofocus:
false
,
postDetailsToFirestore
(
context
);
isThreeLine:
true
,
}
activeColor:
Colors
.
green
,
},
checkColor:
Colors
.
white
,
child:
Text
(
'Save'
),
selected:
_valu3
,
value:
_valu3
,
onChanged:
(
bool
?
value
)
{
setState
(()
{
_valu3
=
value
??
false
;
});
},
),
//CheckboxListTile
),
SizedBox
(
height:
20
),
Container
(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(20),
// boxShadow: [
// BoxShadow(
// color: Colors.black,
// offset: const Offset(
// 3.0,
// 3.0,
// ), //Offset
// blurRadius: 10.0,
// spreadRadius: 2.0,
// ), //BoxShadow
// BoxShadow(
// color: Colors.white,
// offset: const Offset(0.0, 0.0),
// blurRadius: 0.0,
// spreadRadius: 0.0,
// ), //BoxShadow
// ],
// ), //BoxDecoration
/** CheckboxListTile Widget **/
child:
CheckboxListTile
(
title:
const
Text
(
'Socializing'
),
subtitle:
const
Text
(
'Play with groups, Help each other, Friendly towards peers.'
),
// secondary: CircleAvatar(
// backgroundImage: NetworkImage(
// "https://pbs.twimg.com/profile_images/1304985167476523008/QNHrwL2q_400x400.jpg"), //NetworkImage
// radius: 20,
// ),
autofocus:
false
,
isThreeLine:
true
,
activeColor:
Colors
.
green
,
checkColor:
Colors
.
white
,
selected:
_valu4
,
value:
_valu4
,
onChanged:
(
bool
?
value
)
{
setState
(()
{
_valu4
=
value
??
false
;
});
},
),
//CheckboxListTile
),
// SizedBox(height: 20),
// Container(
// // decoration: BoxDecoration(
// // borderRadius: BorderRadius.circular(20),
// // boxShadow: [
// // BoxShadow(
// // color: Colors.black,
// // offset: const Offset(
// // 3.0,
// // 3.0,
// // ), //Offset
// // blurRadius: 10.0,
// // spreadRadius: 2.0,
// // ), //BoxShadow
// // BoxShadow(
// // color: Colors.white,
// // offset: const Offset(0.0, 0.0),
// // blurRadius: 0.0,
// // spreadRadius: 0.0,
// // ), //BoxShadow
// // ],
// // ), //BoxDecoration
// /** CheckboxListTile Widget **/
// child: CheckboxListTile(
// title: const Text('GeeksforGeeks'),
// subtitle: const Text(
// 'A computer science portal for geeks. Here you will find articles on all the technologies.'),
// // secondary: CircleAvatar(
// // backgroundImage: NetworkImage(
// // "https://pbs.twimg.com/profile_images/1304985167476523008/QNHrwL2q_400x400.jpg"), //NetworkImage
// // radius: 20,
// // ),
// autofocus: false,
// isThreeLine: true,
// activeColor: Colors.green,
// checkColor: Colors.white,
// selected: _valu5,
// value: _valu5,
// onChanged: (bool? value) {
// setState(() {
// _valu5 = value ?? false;
// });
// },
// ), //CheckboxListTile
// ),
// SizedBox(height: 20),
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
TextButton
(
onPressed:
()
async
{
postDetailsToFirestore
(
context
);
},
style:
TextButton
.
styleFrom
(
backgroundColor:
Colors
.
green
),
child:
Text
(
'Save'
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
14
,
fontFamily:
'Poppins'
,
fontWeight:
FontWeight
.
w600
,
height:
1
,
),
),
),
),
SizedBox
(
width:
15
),
TextButton
(
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
},
},
style:
TextButton
.
styleFrom
(
child:
Text
(
'Cancel'
),
backgroundColor:
Colors
.
grey
.
shade200
),
child:
Text
(
'Cancel'
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
14
,
fontFamily:
'Poppins'
,
fontWeight:
FontWeight
.
w600
,
height:
1
,
),
),
),
)
],
]
,
)
,
)
,
]
,
]
,
)
,
),
//Container
),
),
//Padding
),
),
//Center
),
),
//SizedBox
),
);
);
}
}
...
@@ -318,16 +113,18 @@ class _kidsReportPageState extends State<KidsReportPage> {
...
@@ -318,16 +113,18 @@ class _kidsReportPageState extends State<KidsReportPage> {
FirebaseFirestore
firebaseFirestore
=
FirebaseFirestore
.
instance
;
FirebaseFirestore
firebaseFirestore
=
FirebaseFirestore
.
instance
;
var
user
=
_auth
.
currentUser
;
var
user
=
_auth
.
currentUser
;
CollectionReference
ref
=
FirebaseFirestore
.
instance
.
collection
(
'reports'
);
CollectionReference
ref
=
FirebaseFirestore
.
instance
.
collection
(
'reports'
);
ref
.
doc
(
id
).
set
({
// Constructing the data to be saved
"q1"
:
_valu1
,
Map
<
String
,
dynamic
>
data
=
{};
'q2'
:
_valu2
,
dropdownMap
.
forEach
((
key
,
value
)
{
'q3'
:
_valu3
,
data
[
key
]
=
value
;
"q4"
:
_valu4
,
'q5'
:
_valu5
,
'sId'
:
id
,
});
});
data
[
'sId'
]
=
id
;
await
ref
.
doc
(
id
).
set
(
data
);
AwesomeDialog
(
AwesomeDialog
(
context:
context
,
context:
context
,
dialogType:
DialogType
.
success
,
dialogType:
DialogType
.
success
,
...
...
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