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
7586ce3b
Commit
7586ce3b
authored
Mar 14, 2024
by
Uditha Prabhasha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update kidsReport.dart
parent
45c024a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
204 additions
and
64 deletions
+204
-64
lib/kidsReport.dart
lib/kidsReport.dart
+204
-64
No files found.
lib/kidsReport.dart
View file @
7586ce3b
...
...
@@ -15,17 +15,60 @@ class _KidsReportPageState extends State<KidsReportPage> {
String
id
;
_KidsReportPageState
({
required
this
.
id
});
List
<
String
>
dropdownValues
=
[
'1'
,
'2'
,
'3'
,
'4'
,
'5'
];
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
,
List
<
String
>
dropdownValues
=
[
'Select'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
];
Map
<
String
,
String
?>
understandingDropdownMap
=
{
'Understanding commands'
:
'Select'
,
'Answer questions'
:
'Select'
,
'Keeping eye contact'
:
'Select'
,
'Following rules'
:
'Select'
,
};
Map
<
String
,
String
?>
movementsDropdownMap
=
{
'Motor activities'
:
'Select'
,
'Correct posture'
:
'Select'
,
};
Map
<
String
,
String
?>
manipulatingDropdownMap
=
{
'Can build/create new things'
:
'Select'
,
'Knows how to handle accessories'
:
'Select'
,
};
Map
<
String
,
String
?>
socializingDropdownMap
=
{
'Play with groups'
:
'Select'
,
'Help each other'
:
'Select'
,
'Friendly towards peers'
:
'Select'
,
'Close to teacher'
:
'Select'
,
};
Map
<
String
,
String
?>
speechDropdownMap
=
{
'Communicate well'
:
'Select'
,
'Like singing'
:
'Select'
,
};
Map
<
String
,
String
?>
recognitionDropdownMap
=
{
'Can express with pictures and words'
:
'Select'
,
'Identify shapes'
:
'Select'
,
'Knows Primary colors. s'
:
'Select'
,
'Identify basic objects in the environment'
:
'Select'
,
};
Map
<
String
,
String
?>
habitsDropdownMap
=
{
'Organized'
:
'Select'
,
'Have good eating habits'
:
'Select'
,
'Taking care of own needs'
:
'Select'
,
};
Map
<
String
,
String
?>
personalHygieneDropdownMap
=
{
'Stay clean'
:
'Select'
,
'Keep the workplace and environment clean'
:
'Select'
,
};
Map
<
String
,
String
?>
personalityDropdownMap
=
{
'Act according to the situation'
:
'Select'
,
'Finish allocated work'
:
'Select'
,
'More active'
:
'Select'
,
'Less active'
:
'Select'
,
};
final
_formkey
=
GlobalKey
<
FormState
>();
...
...
@@ -44,45 +87,54 @@ class _KidsReportPageState extends State<KidsReportPage> {
child:
Form
(
key:
_formkey
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Table
(
columnWidths:
{
0
:
FlexColumnWidth
(
3
),
1
:
FlexColumnWidth
(
1
),
},
children:
dropdownMap
.
keys
.
map
((
String
key
)
{
return
TableRow
(
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Text
(
key
),
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Understanding'
,
dropdownMap:
understandingDropdownMap
,
),
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
DropdownButtonFormField
<
String
>(
value:
dropdownMap
[
key
],
items:
dropdownValues
.
map
((
String
value
)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
}).
toList
(),
onChanged:
(
String
?
value
)
{
setState
(()
{
dropdownMap
[
key
]
=
value
;
});
},
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Movements'
,
dropdownMap:
movementsDropdownMap
,
),
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Manipulating'
,
dropdownMap:
manipulatingDropdownMap
,
),
],
);
}).
toList
(),
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Socializing'
,
dropdownMap:
socializingDropdownMap
,
),
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Speech'
,
dropdownMap:
speechDropdownMap
,
),
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Recognition'
,
dropdownMap:
recognitionDropdownMap
,
),
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Habits'
,
dropdownMap:
habitsDropdownMap
,
),
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Personal Hygiene'
,
dropdownMap:
personalHygieneDropdownMap
,
),
SizedBox
(
height:
20
),
_buildDropdownSection
(
title:
'Personality'
,
dropdownMap:
personalityDropdownMap
,
),
SizedBox
(
height:
20
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
ElevatedButton
(
onPressed:
()
async
{
if
(
_formkey
.
currentState
!.
validate
())
{
...
...
@@ -91,22 +143,86 @@ class _KidsReportPageState extends State<KidsReportPage> {
},
child:
Text
(
'Save'
),
),
SizedBox
(
width:
15
),
SizedBox
(
height:
10
),
ElevatedButton
(
onPressed:
()
{
Navigator
.
pop
(
context
);
},
child:
Text
(
'Cancel'
),
),
SizedBox
(
height:
20
),
],
),
],
),
),
),
),
);
}
Widget
_buildDropdownSection
({
required
String
title
,
required
Map
<
String
,
String
?>
dropdownMap
,
})
{
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
[
Text
(
title
,
style:
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
bold
,
),
),
SizedBox
(
height:
10
),
...
dropdownMap
.
keys
.
map
((
String
key
)
{
return
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8.0
),
child:
Row
(
children:
[
Expanded
(
flex:
3
,
child:
Text
(
key
,
style:
TextStyle
(
fontSize:
16
),
),
),
Expanded
(
flex:
1
,
child:
Container
(
width:
100
,
// Adjust the width as needed
child:
DropdownButton
<
String
>(
value:
dropdownMap
[
key
],
icon:
Icon
(
Icons
.
arrow_drop_down
),
iconSize:
24
,
elevation:
16
,
style:
TextStyle
(
color:
Colors
.
black
),
underline:
Container
(
height:
1
,
color:
Colors
.
green
,
),
onChanged:
(
String
?
value
)
{
setState
(()
{
dropdownMap
[
key
]
=
value
;
});
},
items:
dropdownValues
.
map
<
DropdownMenuItem
<
String
>>(
(
String
value
)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
},
).
toList
(),
),
),
),
],
),
);
}).
toList
(),
],
);
}
postDetailsToFirestore
(
context
)
async
{
...
...
@@ -118,7 +234,31 @@ class _KidsReportPageState extends State<KidsReportPage> {
// Constructing the data to be saved
Map
<
String
,
dynamic
>
data
=
{};
dropdownMap
.
forEach
((
key
,
value
)
{
understandingDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
movementsDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
manipulatingDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
socializingDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
speechDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
recognitionDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
habitsDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
personalHygieneDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
personalityDropdownMap
.
forEach
((
key
,
value
)
{
data
[
key
]
=
value
;
});
data
[
'sId'
]
=
id
;
...
...
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