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
bf389e09
Commit
bf389e09
authored
May 20, 2024
by
Uditha Prabhasha Dharmarathna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Update V1.5
parent
977c086c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
286 additions
and
224 deletions
+286
-224
.DS_Store
.DS_Store
+0
-0
lib/ActivitiesView copy.dart
lib/ActivitiesView copy.dart
+101
-0
lib/ChildrenActivity.dart
lib/ChildrenActivity.dart
+20
-20
lib/ChildrenProfile_parent.dart
lib/ChildrenProfile_parent.dart
+39
-39
lib/activities.dart
lib/activities.dart
+11
-11
lib/addstudent.dart
lib/addstudent.dart
+41
-98
lib/games.dart
lib/games.dart
+74
-56
No files found.
.DS_Store
View file @
bf389e09
No preview for this file type
lib/ActivitiesView copy.dart
0 → 100644
View file @
bf389e09
// import 'package:flutter/material.dart';
// import 'package:cloud_firestore/cloud_firestore.dart';
// import 'package:cached_network_image/cached_network_image.dart';
// import 'package:video_player/video_player.dart';
// class UserActivitiesScreen extends StatelessWidget {
// final String userId;
// UserActivitiesScreen({required this.userId});
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// appBar: AppBar(
// title: Text('User Activities'),
// ),
// body: StreamBuilder<QuerySnapshot>(
// stream: FirebaseFirestore.instance
// .collection('activities')
// .where('user', isEqualTo: userId)
// .snapshots(),
// builder: (context, snapshot) {
// if (snapshot.connectionState == ConnectionState.waiting) {
// return CircularProgressIndicator(); // Loading indicator
// }
// if (snapshot.hasError) {
// return Text('Error: ${snapshot.error}'); // Error handling
// }
// if (snapshot.data == null || snapshot.data!.docs.isEmpty) {
// return Center(
// child: Text('No activities found for this user.'),
// ); // No activities found
// }
// return ListView(
// children: snapshot.data!.docs.map((document) {
// final videoUrl = document['videoUrl'];
// final imageUrl = document['imageUrl'];
// if (videoUrl != null) {
// return _buildVideoItem(videoUrl);
// } else if (imageUrl != null) {
// return _buildImageItem(imageUrl);
// } else {
// return SizedBox(); // Return an empty widget if neither video nor image URL is available
// }
// }).toList(),
// );
// },
// ),
// );
// }
// Widget _buildVideoItem(String videoUrl) {
// return ListTile(
// title: Text('Activity Video'),
// leading: FutureBuilder(
// future: VideoPlayerController.network(videoUrl).initialize(),
// builder: (context, snapshot) {
// if (snapshot.connectionState == ConnectionState.waiting) {
// return CircularProgressIndicator(); // Placeholder while video loads
// }
// if (snapshot.hasError) {
// return Text('Error: ${snapshot.error}');
// }
// if (snapshot.connectionState == ConnectionState.done) {
// try {
// final controller = VideoPlayerController.network(videoUrl);
// return AspectRatio(
// aspectRatio: controller.value.aspectRatio,
// child: VideoPlayer(controller),
// );
// } catch (e) {
// return Text('Error playing video: $e');
// }
// } else {
// return SizedBox(); // Return empty widget if still loading
// }
// },
// ),
// onTap: () {
// // Handle tap, e.g., navigate to a detail screen
// },
// );
// }
// Widget _buildImageItem(String imageUrl) {
// return ListTile(
// title: Text('Activity Image'),
// leading: CachedNetworkImage(
// imageUrl: imageUrl,
// placeholder: (context, url) =>
// CircularProgressIndicator(), // Placeholder while image loads
// errorWidget: (context, url, error) => Icon(Icons.error),
// ),
// onTap: () {
// // Handle tap, e.g., navigate to a detail screen
// },
// );
// }
// }
\ No newline at end of file
lib/ChildrenActivity.dart
View file @
bf389e09
...
@@ -190,29 +190,29 @@ class ChildrenActivity extends StatelessWidget {
...
@@ -190,29 +190,29 @@ class ChildrenActivity extends StatelessWidget {
),
),
),
),
),
),
GestureDetector
(
//
GestureDetector(
onTap:
()
{
//
onTap: () {
// Navigator.of(context).push(MaterialPageRoute(
// Navigator.of(context).push(MaterialPageRoute(
// builder: (_) => ReportKidsPage( classroom: ),
// builder: (_) => ReportKidsPage( classroom: ),
// ));
// ));
},
//
},
child:
Padding
(
//
child: Padding(
padding:
const
EdgeInsets
.
all
(
10.0
),
//
padding: const EdgeInsets.all(10.0),
child:
Container
(
//
child: Container(
width:
170
,
//
width: 170,
height:
85
,
//
height: 85,
clipBehavior:
Clip
.
antiAlias
,
//
clipBehavior: Clip.antiAlias,
decoration:
BoxDecoration
(
//
decoration: BoxDecoration(
image:
DecorationImage
(
//
image: DecorationImage(
image:
AssetImage
(
//
image: AssetImage(
'lib/assets/ac6.png'
),
//
'lib/assets/ac6.png'),
fit:
BoxFit
//
fit: BoxFit
.
cover
,
//
.cover,
)),
//
)),
),
//
),
),
//
),
),
//
),
]),
]),
],
],
),
),
),
),
...
...
lib/ChildrenProfile_parent.dart
View file @
bf389e09
...
@@ -900,45 +900,45 @@ class pChildrenProfilePage extends StatelessWidget {
...
@@ -900,45 +900,45 @@ class pChildrenProfilePage extends StatelessWidget {
],
],
),
),
),
),
bottomNavigationBar:
BottomNavigationBar
(
//
bottomNavigationBar: BottomNavigationBar(
items:
const
[
//
items: const [
BottomNavigationBarItem
(
//
BottomNavigationBarItem(
icon:
Icon
(
Icons
.
home
),
//
icon: Icon(Icons.home),
label:
'Home'
,
//
label: 'Home',
),
//
),
BottomNavigationBarItem
(
//
BottomNavigationBarItem(
icon:
Icon
(
Icons
.
chat
),
//
icon: Icon(Icons.chat),
label:
'Chat'
,
//
label: 'Chat',
),
//
),
BottomNavigationBarItem
(
//
BottomNavigationBarItem(
icon:
Icon
(
Icons
.
person
),
//
icon: Icon(Icons.person),
label:
'Profile'
,
//
label: 'Profile',
),
//
),
],
//
],
selectedItemColor:
Colors
.
blue
,
//
selectedItemColor: Colors.blue,
onTap:
(
index
)
{
//
onTap: (index) {
// Handle bottom navigation item tap
//
// Handle bottom navigation item tap
if
(
index
==
0
)
{
//
if (index == 0) {
Navigator
.
push
(
//
Navigator.push(
context
,
//
context,
MaterialPageRoute
(
builder:
(
context
)
=>
TeacherHomePage
()),
//
MaterialPageRoute(builder: (context) => TeacherHomePage()),
);
//
);
}
//
}
if
(
index
==
1
)
{
//
if (index == 1) {
Navigator
.
push
(
//
Navigator.push(
context
,
//
context,
MaterialPageRoute
(
builder:
(
context
)
=>
ChatScreen
()),
//
MaterialPageRoute(builder: (context) => ChatScreen()),
);
//
);
}
//
}
if
(
index
==
2
)
{
//
if (index == 2) {
Navigator
.
push
(
//
Navigator.push(
context
,
//
context,
MaterialPageRoute
(
//
MaterialPageRoute(
builder:
(
context
)
=>
TeacherProfilePage
(
uid:
user
?.
uid
)),
//
builder: (context) => TeacherProfilePage(uid: user?.uid)),
);
//
);
}
//
}
},
//
},
),
//
),
),
),
);
);
}
}
...
...
lib/activities.dart
View file @
bf389e09
...
@@ -60,17 +60,17 @@ class ActivitiesPage extends StatelessWidget {
...
@@ -60,17 +60,17 @@ class ActivitiesPage extends StatelessWidget {
),
),
],
],
),
),
SizedBox
(
height:
20
),
//
SizedBox(height: 20),
Row
(
//
Row(
children:
[
//
children: [
Expanded
(
//
Expanded(
child:
ActivityBox
(
//
child: ActivityBox(
title:
'Environment'
,
//
title: 'Environment',
icon:
Icons
.
child_care
,
//
icon: Icons.child_care,
),
//
),
),
//
),
],
//
],
),
//
),
],
],
),
),
),
),
...
...
lib/addstudent.dart
View file @
bf389e09
...
@@ -5,8 +5,6 @@ import 'package:firebase_storage/firebase_storage.dart';
...
@@ -5,8 +5,6 @@ import 'package:firebase_storage/firebase_storage.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'dart:io'
;
import
'dart:io'
;
import
'package:intl/intl.dart'
;
class
AddStudentPage
extends
StatefulWidget
{
class
AddStudentPage
extends
StatefulWidget
{
const
AddStudentPage
({
required
this
.
classname
});
const
AddStudentPage
({
required
this
.
classname
});
...
@@ -19,7 +17,6 @@ class AddStudentPage extends StatefulWidget {
...
@@ -19,7 +17,6 @@ class AddStudentPage extends StatefulWidget {
class
_AddStudentState
extends
State
<
AddStudentPage
>
{
class
_AddStudentState
extends
State
<
AddStudentPage
>
{
final
_formkey
=
GlobalKey
<
FormState
>();
final
_formkey
=
GlobalKey
<
FormState
>();
final
_auth
=
FirebaseAuth
.
instance
;
final
_auth
=
FirebaseAuth
.
instance
;
//Bio Part
//Bio Part
TextEditingController
_firstnameController
=
TextEditingController
();
TextEditingController
_firstnameController
=
TextEditingController
();
TextEditingController
_lastnameController
=
TextEditingController
();
TextEditingController
_lastnameController
=
TextEditingController
();
...
@@ -53,9 +50,6 @@ class _AddStudentState extends State<AddStudentPage> {
...
@@ -53,9 +50,6 @@ class _AddStudentState extends State<AddStudentPage> {
XFile
?
_selectedImage
;
XFile
?
_selectedImage
;
String
classname
;
String
classname
;
String
?
_selectedSex
;
DateTime
?
_selectedBirthday
;
_AddStudentState
(
String
classname
)
:
this
.
classname
=
classname
;
_AddStudentState
(
String
classname
)
:
this
.
classname
=
classname
;
@override
@override
...
@@ -169,38 +163,13 @@ class _AddStudentState extends State<AddStudentPage> {
...
@@ -169,38 +163,13 @@ class _AddStudentState extends State<AddStudentPage> {
),
),
),
),
// SizedBox(height: 20),
// GestureDetector(
// onTap: () => _selectDate(context),
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
// decoration: BoxDecoration(
// color: Color.fromARGB(107, 196, 196, 196),
// borderRadius: BorderRadius.circular(10.0),
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // Aligns children to both ends
// children: [
// Expanded( // Text takes up all available space, pushing the icon to the right
// child: Text(
// _selectedBirthday != null ? DateFormat('yyyy-MM-dd').format(_selectedBirthday!) : 'Select Birthday',
// style: TextStyle(fontSize: 14.0, color: Colors.black54),
// ),
// ),
// Icon(Icons.cake, size: 23.0, color: Color.fromARGB(132, 12, 12, 12)), // Icon on the right
// ],
// ),
// ),
// ),
SizedBox
(
height:
20
),
SizedBox
(
height:
20
),
Container
(
Container
(
height:
55.0
,
height:
55.0
,
child:
TextField
(
child:
TextField
(
controller:
_birthdayController
,
controller:
_birthdayController
,
decoration:
InputDecoration
(
decoration:
InputDecoration
(
hintText:
'Birthday'
,
hintText:
'Birthday
YYYY-MM-DD
'
,
filled:
true
,
filled:
true
,
fillColor:
Color
.
fromARGB
(
107
,
196
,
196
,
196
),
fillColor:
Color
.
fromARGB
(
107
,
196
,
196
,
196
),
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
...
@@ -217,34 +186,25 @@ class _AddStudentState extends State<AddStudentPage> {
...
@@ -217,34 +186,25 @@ class _AddStudentState extends State<AddStudentPage> {
SizedBox
(
height:
20
),
SizedBox
(
height:
20
),
Container
(
Container
(
height:
55.0
,
height:
55.0
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
2
),
child:
TextField
(
decoration:
BoxDecoration
(
controller:
_sexController
,
color:
Color
.
fromARGB
(
107
,
196
,
196
,
196
),
// Background color
borderRadius:
BorderRadius
.
circular
(
10.0
),
// Border radius
),
child:
DropdownButtonFormField
<
String
>(
value:
_selectedSex
,
// This should be a variable in your state class initialized to null or the default value
decoration:
InputDecoration
(
decoration:
InputDecoration
(
border:
InputBorder
.
none
,
hintText:
'Male/Female'
,
// contentPadding: EdgeInsets.zero,
filled:
true
,
suffixIcon:
Icon
(
Icons
.
people
,
size:
23.0
,
color:
Color
.
fromARGB
(
132
,
12
,
12
,
12
)),
fillColor:
Color
.
fromARGB
(
107
,
196
,
196
,
196
),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
10.0
),
borderSide:
BorderSide
.
none
,
),
suffixIcon:
Icon
(
Icons
.
people
,
size:
23.0
,
color:
Color
.
fromARGB
(
132
,
12
,
12
,
12
)),
hintStyle:
TextStyle
(
fontSize:
14.0
),
// Add border here
),
),
hint:
Text
(
'Gender'
,
style:
TextStyle
(
fontSize:
14.0
)),
// Placeholder text
onChanged:
(
String
?
newValue
)
{
setState
(()
{
_selectedSex
=
newValue
;
// Update the state with the new value
});
},
items:
<
String
>[
'Male'
,
'Female'
].
map
<
DropdownMenuItem
<
String
>>((
String
value
)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
}).
toList
(),
),
),
),
),
//Medicine Part
//Medicine Part
SizedBox
(
height:
50
),
SizedBox
(
height:
50
),
Row
(
Row
(
children:
[
children:
[
...
@@ -626,7 +586,7 @@ class _AddStudentState extends State<AddStudentPage> {
...
@@ -626,7 +586,7 @@ class _AddStudentState extends State<AddStudentPage> {
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
children:
[
Elevated
Button
(
Text
Button
(
onPressed:
()
async
{
onPressed:
()
async
{
if
(
Image
==
null
)
{
if
(
Image
==
null
)
{
AwesomeDialog
(
AwesomeDialog
(
...
@@ -704,38 +664,36 @@ class _AddStudentState extends State<AddStudentPage> {
...
@@ -704,38 +664,36 @@ class _AddStudentState extends State<AddStudentPage> {
}
}
},
},
style:
style:
ElevatedButton
.
styleFrom
(
TextButton
.
styleFrom
(
backgroundColor:
Colors
.
green
),
primary:
const
Color
.
fromARGB
(
255
,
48
,
206
,
53
),
child:
Text
(
shape:
RoundedRectangleBorder
(
'Save'
,
borderRadius:
BorderRadius
.
circular
(
10.0
),
style:
TextStyle
(
),
color:
Colors
.
white
,
fontSize:
14
,
fontFamily:
'Poppins'
,
fontWeight:
FontWeight
.
w600
,
height:
1
,
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
Text
(
'Save'
,
style:
TextStyle
(
color:
const
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
),
),
),
),
),
ElevatedButton
(
TextButton
(
onPressed:
()
{
onPressed:
()
{
Navigator
.
pop
(
context
);
// Handle signup logic here
},
Navigator
.
pop
(
context
);
style:
ElevatedButton
.
styleFrom
(
},
primary:
const
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
style:
TextButton
.
styleFrom
(
shape:
RoundedRectangleBorder
(
backgroundColor:
Colors
.
grey
.
shade200
),
borderRadius:
BorderRadius
.
circular
(
10.0
),
child:
Text
(
),
'Cancel'
,
),
style:
TextStyle
(
child:
Padding
(
color:
Colors
.
black
,
padding:
const
EdgeInsets
.
all
(
10.0
),
fontSize:
14
,
child:
Text
(
fontFamily:
'Poppins'
,
'Cancel'
,
fontWeight:
FontWeight
.
w600
,
style:
TextStyle
(
color:
Colors
.
black
),
height:
1
,
),
),
),
),
),
)
],
],
),
),
],
],
...
@@ -807,19 +765,4 @@ class _AddStudentState extends State<AddStudentPage> {
...
@@ -807,19 +765,4 @@ class _AddStudentState extends State<AddStudentPage> {
},
},
)..
show
();
)..
show
();
}
}
}
}
\ No newline at end of file
Future
<
void
>
_selectDate
(
BuildContext
context
)
async
{
final
DateTime
?
pickedDate
=
await
showDatePicker
(
context:
context
,
initialDate:
DateTime
.
now
(),
// Initial date set to current date
firstDate:
DateTime
(
1900
),
// Earliest allowable date
lastDate:
DateTime
.
now
(),
// Latest allowable date is today
);
// if (pickedDate != null && pickedDate != DateTime.now()) {
// setState(() {
// // Format the date and update the text field
// _birthdayController.text = DateFormat('yyyy-MM-dd').format(pickedDate);
// });
// }
}
lib/games.dart
View file @
bf389e09
...
@@ -11,9 +11,27 @@ class GamesPage extends StatelessWidget {
...
@@ -11,9 +11,27 @@ class GamesPage extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
title:
Text
(
'Games'
),
leading:
IconButton
(
),
icon:
Icon
(
Icons
.
arrow_back
),
onPressed:
()
{
Navigator
.
of
(
context
).
pop
();
},
),
actions:
[
Text
(
'Games '
,
style:
TextStyle
(
color:
Color
(
0xFF554994
),
fontSize:
24
,
fontFamily:
'Poppins'
,
fontWeight:
FontWeight
.
w700
,
height:
0.04
,
letterSpacing:
-
0.96
,
),
)
],
),
body:
Column
(
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
...
@@ -145,59 +163,59 @@ class GamesPage extends StatelessWidget {
...
@@ -145,59 +163,59 @@ class GamesPage extends StatelessWidget {
],
],
),
),
bottomNavigationBar:
BottomNavigationBar
(
//
bottomNavigationBar: BottomNavigationBar(
items:
const
[
//
items: const [
BottomNavigationBarItem
(
//
BottomNavigationBarItem(
icon:
Icon
(
Icons
.
home
),
//
icon: Icon(Icons.home),
label:
'Home'
,
//
label: 'Home',
),
//
),
BottomNavigationBarItem
(
//
BottomNavigationBarItem(
icon:
Icon
(
Icons
.
chat
),
//
icon: Icon(Icons.chat),
label:
'Chat'
,
//
label: 'Chat',
),
//
),
BottomNavigationBarItem
(
//
BottomNavigationBarItem(
icon:
Icon
(
Icons
.
sports_baseball
),
//
icon: Icon(Icons.sports_baseball),
label:
'Games'
,
//
label: 'Games',
),
//
),
BottomNavigationBarItem
(
//
BottomNavigationBarItem(
icon:
Icon
(
Icons
.
person
),
//
icon: Icon(Icons.person),
label:
'Profile'
,
//
label: 'Profile',
),
//
),
],
//
],
selectedItemColor:
Colors
.
blueAccent
,
//
selectedItemColor: Colors.blueAccent,
unselectedItemColor:
Colors
.
grey
,
//
unselectedItemColor: Colors.grey,
currentIndex:
2
,
//
currentIndex: 2,
onTap:
(
index
)
{
//
onTap: (index) {
switch
(
index
)
{
//
switch (index) {
case
0
:
//
case 0:
// Navigate to Home
//
// Navigate to Home
// Navigator.push(
//
// Navigator.push(
// context,
//
// context,
// MaterialPageRoute(builder: (context) => ParentHomePage(phoneNo, role)),
//
// MaterialPageRoute(builder: (context) => ParentHomePage(phoneNo, role)),
// );
//
// );
break
;
//
break;
case
1
:
//
case 1:
// Navigate to Chat
//
// Navigate to Chat
Navigator
.
push
(
//
Navigator.push(
context
,
//
context,
MaterialPageRoute
(
builder:
(
context
)
=>
ChatScreen
()),
//
MaterialPageRoute(builder: (context) => ChatScreen()),
);
//
);
break
;
//
break;
case
2
:
//
case 2:
// Do nothing, we are already on the Games page
//
// Do nothing, we are already on the Games page
break
;
//
break;
case
3
:
//
case 3:
// Navigate to Profile
//
// Navigate to Profile
// Navigator.push(
//
// Navigator.push(
// context,
//
// context,
// MaterialPageRoute(
//
// MaterialPageRoute(
// builder: (context) => ParentProfilePage(uid: uid, phoneNo: phoneNo, role: role),
//
// builder: (context) => ParentProfilePage(uid: uid, phoneNo: phoneNo, role: role),
// ),
//
// ),
// );
//
// );
break
;
//
break;
}
//
}
},
//
},
),
//
),
);
);
}
}
}
}
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