Commit 10e73d8d authored by Uditha Prabhasha 's avatar Uditha Prabhasha

update uditha

parent 4019eb83
No preview for this file type
...@@ -668,13 +668,13 @@ ...@@ -668,13 +668,13 @@
"languageVersion": "3.0" "languageVersion": "3.0"
}, },
{ {
"name": "jema_app", "name": "mobile_application_kids",
"rootUri": "../", "rootUri": "../",
"packageUri": "lib/", "packageUri": "lib/",
"languageVersion": "3.0" "languageVersion": "3.0"
} }
], ],
"generated": "2024-03-09T19:18:50.460515Z", "generated": "2024-03-17T10:38:35.142846Z",
"generator": "pub", "generator": "pub",
"generatorVersion": "3.0.1" "generatorVersion": "3.0.1"
} }
...@@ -442,8 +442,8 @@ xdg_directories ...@@ -442,8 +442,8 @@ xdg_directories
3.0 3.0
file:///Users/avishkanew/.pub-cache/hosted/pub.dev/xdg_directories-1.0.4/ file:///Users/avishkanew/.pub-cache/hosted/pub.dev/xdg_directories-1.0.4/
file:///Users/avishkanew/.pub-cache/hosted/pub.dev/xdg_directories-1.0.4/lib/ file:///Users/avishkanew/.pub-cache/hosted/pub.dev/xdg_directories-1.0.4/lib/
jema_app mobile_application_kids
3.0 3.0
file:///Users/avishkanew/Desktop/Avishk678/monitoring-and-recommendations-for-early-childhood-development/ file:///Users/avishkanew/Documents/Jema678/monitoring-and-recommendations-for-early-childhood-development/
file:///Users/avishkanew/Desktop/Avishk678/monitoring-and-recommendations-for-early-childhood-development/lib/ file:///Users/avishkanew/Documents/Jema678/monitoring-and-recommendations-for-early-childhood-development/lib/
2 2
This diff is collapsed.
...@@ -214,7 +214,9 @@ class MessageBubble extends StatelessWidget { ...@@ -214,7 +214,9 @@ class MessageBubble extends StatelessWidget {
alignment: isCurrentUser ? Alignment.centerRight : Alignment.centerLeft, alignment: isCurrentUser ? Alignment.centerRight : Alignment.centerLeft,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: isCurrentUser ? Colors.blue : Colors.green, color: isCurrentUser
? Color.fromARGB(36, 85, 193, 255)
: const Color.fromARGB(255, 240, 240, 240),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
...@@ -228,12 +230,18 @@ class MessageBubble extends StatelessWidget { ...@@ -228,12 +230,18 @@ class MessageBubble extends StatelessWidget {
imageUrl!, imageUrl!,
width: 200, width: 200,
), ),
if (message.isNotEmpty) Text(message), if (message.isNotEmpty)
Text(
message,
style: TextStyle(
fontSize: 18,
),
),
Text( Text(
userName, userName,
style: TextStyle( style: TextStyle(
color: Color.fromARGB(255, 248, 4, 4), color: Color.fromARGB(255, 29, 51, 243),
fontSize: 8, fontSize: 12,
), ),
) )
], ],
......
...@@ -86,7 +86,7 @@ class CheckKidsPage extends StatelessWidget { ...@@ -86,7 +86,7 @@ class CheckKidsPage extends StatelessWidget {
stream: _usersStream, stream: _usersStream,
builder: (context, snapshot) { builder: (context, snapshot) {
print("--------------------------------------"); print("--------------------------------------");
print(snapshot.data!.docs.length); // print(snapshot.data!.docs.length);
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); return CircularProgressIndicator();
} }
......
...@@ -116,9 +116,9 @@ class ChildrenActivity extends StatelessWidget { ...@@ -116,9 +116,9 @@ class ChildrenActivity extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
'lib/assets/ac1.png'), // Replace 'path/to/your/image.jpg' with your image path 'lib/assets/ac1.png'),
fit: BoxFit fit: BoxFit
.cover, // Adjust this according to your needs .cover,
)), )),
), ),
), ),
...@@ -136,9 +136,9 @@ class ChildrenActivity extends StatelessWidget { ...@@ -136,9 +136,9 @@ class ChildrenActivity extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
'lib/assets/ac2.png'), // Replace 'path/to/your/image.jpg' with your image path 'lib/assets/ac2.png'),
fit: BoxFit fit: BoxFit
.cover, // Adjust this according to your needs .cover,
)), )),
), ),
), ),
...@@ -158,9 +158,9 @@ class ChildrenActivity extends StatelessWidget { ...@@ -158,9 +158,9 @@ class ChildrenActivity extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
'lib/assets/ac3.png'), // Replace 'path/to/your/image.jpg' with your image path 'lib/assets/ac7.png'),
fit: BoxFit fit: BoxFit
.cover, // Adjust this according to your needs .cover,
)), )),
), ),
), ),
...@@ -180,9 +180,9 @@ class ChildrenActivity extends StatelessWidget { ...@@ -180,9 +180,9 @@ class ChildrenActivity extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
'lib/assets/ac4.png'), // Replace 'path/to/your/image.jpg' with your image path 'lib/assets/ac4.png'),
fit: BoxFit fit: BoxFit
.cover, // Adjust this according to your needs .cover,
)), )),
), ),
), ),
...@@ -202,9 +202,9 @@ class ChildrenActivity extends StatelessWidget { ...@@ -202,9 +202,9 @@ class ChildrenActivity extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
'lib/assets/ac5.png'), // Replace 'path/to/your/image.jpg' with your image path 'lib/assets/ac6.png'),
fit: BoxFit fit: BoxFit
.cover, // Adjust this according to your needs .cover,
)), )),
), ),
), ),
......
...@@ -138,7 +138,7 @@ class ChildrenHomePage extends StatelessWidget { ...@@ -138,7 +138,7 @@ class ChildrenHomePage extends StatelessWidget {
stream: _usersStream, stream: _usersStream,
builder: (context, snapshot) { builder: (context, snapshot) {
print("--------------------------------------"); print("--------------------------------------");
print(snapshot.data!.docs.length); // print(snapshot.data!.docs.length);
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); return CircularProgressIndicator();
} }
...@@ -198,7 +198,7 @@ class ChildrenHomePage extends StatelessWidget { ...@@ -198,7 +198,7 @@ class ChildrenHomePage extends StatelessWidget {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (_) => builder: (_) =>
ChildrenProfilePage(document), ChildrenProfilePage(document, 'C'),
), ),
); );
}, },
......
...@@ -26,7 +26,7 @@ class _ParentLoginPage extends State<ParentLoginPage> { ...@@ -26,7 +26,7 @@ class _ParentLoginPage extends State<ParentLoginPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent, backgroundColor: Colors.white,
elevation: 0, elevation: 0,
leading: IconButton( leading: IconButton(
icon: const Icon( icon: const Icon(
...@@ -135,15 +135,16 @@ class _ParentLoginPage extends State<ParentLoginPage> { ...@@ -135,15 +135,16 @@ class _ParentLoginPage extends State<ParentLoginPage> {
child: Container( child: Container(
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(8.0),
color: Colors.green, color: Colors.blueAccent,
), ),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(12.0),
child: Text( child: Text(
'Login', 'Login',
style: TextStyle(color: Colors.black), style:
TextStyle(color: Colors.white, fontSize: 18),
), ),
), ),
), ),
......
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mobile_application_kids/games.dart';
import 'package:mobile_application_kids/login.dart'; import 'package:mobile_application_kids/login.dart';
import 'package:mobile_application_kids/teacherchat.dart'; import 'package:mobile_application_kids/teacherchat.dart';
import 'package:mobile_application_kids/teacherhome.dart'; import 'package:mobile_application_kids/teacherhome.dart';
...@@ -108,7 +107,7 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> { ...@@ -108,7 +107,7 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Bright Sparkle ', 'Bright Sparkle',
style: TextStyle( style: TextStyle(
color: Color(0xFF11324D), color: Color(0xFF11324D),
fontSize: 24, fontSize: 24,
...@@ -155,7 +154,7 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> { ...@@ -155,7 +154,7 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> {
SizedBox( SizedBox(
width: 148, width: 148,
child: Text( child: Text(
'Bright Spark', ' ',
style: TextStyle( style: TextStyle(
color: Color(0xFF473D7F), color: Color(0xFF473D7F),
fontSize: 23, fontSize: 23,
...@@ -488,54 +487,33 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> { ...@@ -488,54 +487,33 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> {
icon: Icon(Icons.chat), icon: Icon(Icons.chat),
label: 'Chat', label: 'Chat',
), ),
BottomNavigationBarItem(
icon: Icon(Icons.videogame_asset),
label: 'Games',
),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Icon(Icons.person), icon: Icon(Icons.person),
label: 'Profile', label: 'Profile',
), ),
], ],
selectedItemColor: Color(0xFF7A1FA0), selectedItemColor: Colors.blue,
unselectedItemColor: Color(0xFFA9ABAD), currentIndex: 2,
selectedLabelStyle: TextStyle(color: Color(0xFF7A1FA0)),
unselectedLabelStyle: TextStyle(color: Color.fromARGB(0, 197, 16, 16)),
currentIndex: 3,
onTap: (index) { onTap: (index) {
switch (index) { // Handle bottom navigation item tap
case 0: if (index == 0) {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => TeacherHomePage()), MaterialPageRoute(builder: (context) => TeacherHomePage()),
); );
break; }
case 1: if (index == 1) {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => ChatScreen()), MaterialPageRoute(builder: (context) => ChatScreen()),
); );
break; }
case 2: if (index == 2) {
// Handle Game
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => GamesPage(
),
),
);
break;
case 3:
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => TeacherProfilePage( builder: (context) => TeacherProfilePage(uid: user?.uid)),
uid: user?.uid,
),
),
); );
break;
} }
}, },
), ),
......
...@@ -44,7 +44,7 @@ class ActivitiesPage extends StatelessWidget { ...@@ -44,7 +44,7 @@ class ActivitiesPage extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: ActivityBox( child: ActivityBox(
title: 'Social Activities', title: 'Coloring Book',
icon: Icons.group, icon: Icons.group,
), ),
), ),
...@@ -62,7 +62,7 @@ class ActivitiesPage extends StatelessWidget { ...@@ -62,7 +62,7 @@ class ActivitiesPage extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: ActivityBox( child: ActivityBox(
title: 'Kid Activity', title: 'Environment',
icon: Icons.child_care, icon: Icons.child_care,
), ),
), ),
......
...@@ -68,11 +68,11 @@ class _AddClassroomPageState extends State<AddClassroomPage> { ...@@ -68,11 +68,11 @@ class _AddClassroomPageState extends State<AddClassroomPage> {
), ),
SizedBox(height: 20), SizedBox(height: 20),
Container( Container(
height: 50.0, height: 48.0,
width: 150.0, width: 200.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.fromARGB(203, 164, 88, 177), color: Colors.blueAccent,
borderRadius: BorderRadius.circular(4.0), borderRadius: BorderRadius.circular(8.0),
), ),
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
......
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jema_app/progressReport.dart'; import 'package:mobile_application_kids/progressReport.dart';
import 'package:jema_app/teacherchat.dart'; import 'package:mobile_application_kids/teacherchat.dart';
import 'package:jema_app/classroomview.dart'; import 'package:mobile_application_kids/classroomview.dart';
import 'package:jema_app/addclassroom.dart'; import 'package:mobile_application_kids/addclassroom.dart';
import 'package:jema_app/teacherhome.dart'; import 'package:mobile_application_kids/teacherhome.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'ActivitiesView.dart'; import 'ActivitiesView.dart';
...@@ -17,8 +17,11 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -17,8 +17,11 @@ class ChildrenProfilePage extends StatelessWidget {
late User? user; late User? user;
late final Stream<QuerySnapshot> _usersStream, _usersStream2; late final Stream<QuerySnapshot> _usersStream, _usersStream2;
int _age = 0; int _age = 0;
String role = '';
late final userDetails; late final userDetails;
ChildrenProfilePage(document) { ChildrenProfilePage(document, role) {
print(role);
this.role = role;
this.userDetails = document; this.userDetails = document;
user = FirebaseAuth.instance.currentUser; user = FirebaseAuth.instance.currentUser;
initializeStreams(); initializeStreams();
...@@ -558,7 +561,8 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -558,7 +561,8 @@ class ChildrenProfilePage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( role == "P"
? Container(
width: 359, width: 359,
height: 178, height: 178,
child: Column( child: Column(
...@@ -572,7 +576,8 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -572,7 +576,8 @@ class ChildrenProfilePage extends StatelessWidget {
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration( decoration: ShapeDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage("lib/assets/banner.png"), image:
AssetImage("lib/assets/banner.png"),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
...@@ -592,8 +597,10 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -592,8 +597,10 @@ class ChildrenProfilePage extends StatelessWidget {
Container( Container(
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container( Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
...@@ -637,7 +644,8 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -637,7 +644,8 @@ class ChildrenProfilePage extends StatelessWidget {
), ),
], ],
), ),
), )
: Container(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
...@@ -652,7 +660,10 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -652,7 +660,10 @@ class ChildrenProfilePage extends StatelessWidget {
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
SingleChildScrollView( Padding(
padding: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.04),
child: SingleChildScrollView(
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
...@@ -663,12 +674,14 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -663,12 +674,14 @@ class ChildrenProfilePage extends StatelessWidget {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ReportKidsViewPage( builder: (context) =>
ReportKidsViewPage(
sid: userDetails.id)), sid: userDetails.id)),
); );
}, },
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.4, width:
MediaQuery.of(context).size.width * 0.4,
height: 135, height: 135,
child: Stack( child: Stack(
children: [ children: [
...@@ -751,7 +764,8 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -751,7 +764,8 @@ class ChildrenProfilePage extends StatelessWidget {
color: Color(0xFF8DAEAE), color: Color(0xFF8DAEAE),
fontSize: 10.55, fontSize: 10.55,
fontFamily: 'Roboto', fontFamily: 'Roboto',
fontWeight: FontWeight.w400, fontWeight:
FontWeight.w400,
height: 0, height: 0,
), ),
), ),
...@@ -859,7 +873,8 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -859,7 +873,8 @@ class ChildrenProfilePage extends StatelessWidget {
color: Color(0xFF8DAEAE), color: Color(0xFF8DAEAE),
fontSize: 10.55, fontSize: 10.55,
fontFamily: 'Roboto', fontFamily: 'Roboto',
fontWeight: FontWeight.w400, fontWeight:
FontWeight.w400,
height: 0, height: 0,
), ),
), ),
...@@ -876,6 +891,7 @@ class ChildrenProfilePage extends StatelessWidget { ...@@ -876,6 +891,7 @@ class ChildrenProfilePage extends StatelessWidget {
], ],
), ),
), ),
),
], ],
), ),
), ),
......
...@@ -54,64 +54,112 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -54,64 +54,112 @@ class ClassroomViewPage extends StatelessWidget {
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height / 20,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container( Container(
height: 35.0, child: SingleChildScrollView(
width: 120.0, scrollDirection: Axis
decoration: BoxDecoration( .horizontal, // Enable horizontal scrolling
color: Color.fromARGB(203, 164, 88, 177), child: Container(
borderRadius: BorderRadius.circular(4.0), width: 333,
padding: const EdgeInsets.symmetric(
horizontal: 56, vertical: 5),
decoration: ShapeDecoration(
color: Color.fromARGB(255, 255, 255, 255),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6)),
shadows: [
BoxShadow(
color: Color(0x3F000000),
blurRadius: 6,
offset: Offset(0, 1),
spreadRadius: 0,
)
],
), ),
child: TextButton( child: Row(
onPressed: () { mainAxisAlignment: MainAxisAlignment.center,
Navigator.push( crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 32,
height: 32,
decoration: ShapeDecoration(
image: DecorationImage(
image: AssetImage(
'lib/assets/Vector 2.png'),
fit: BoxFit.fill,
),
shape: OvalBorder(),
),
),
const SizedBox(width: 40),
FutureBuilder<String>(
future: getStudentCount(),
builder: (context, snapshot) {
if (snapshot.connectionState ==
ConnectionState.waiting) {
return CircularProgressIndicator(); // Show loading indicator
}
if (snapshot.hasError) {
return Text(
'Error: ${snapshot.error}'); // Show error message
}
// Use the result of getStudentCount
return Text(
'Children ' +
(snapshot.data ??
'0'), // Default to '0' if data is null
style: TextStyle(
color: Colors.black,
fontSize: 12,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
),
);
},
),
const SizedBox(width: 8),
GestureDetector(
onTap: () => Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
AddStudentPage(classname: documents)), AddStudentPage(
); classname: documents)),
}, ),
child: Text( child: Container(
'Add Student', margin: EdgeInsets.only(left: 8.0),
style: TextStyle( decoration: BoxDecoration(
color:
Color.fromARGB(203, 164, 88, 177),
borderRadius:
BorderRadius.circular(4.20),
),
child: Icon(
Icons.add,
color: Colors.white, color: Colors.white,
), ),
), ),
), ),
],
), ),
SizedBox(height: 10),
Padding(
padding: EdgeInsets.fromLTRB(width * 0.1, 20, width * 0.1, 20),
child: Container(
width: 293,
height: 44,
decoration: ShapeDecoration(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
), ),
shadows: [
BoxShadow(
color: Color(0x3F000000),
blurRadius: 4,
offset: Offset(0, 1),
spreadRadius: 0,
), ),
],
), ),
child: TextField( ],
controller: _searchController,
onChanged: (value) {
_searchTermController.add(value);
},
decoration: InputDecoration(
hintText: 'Search',
border: InputBorder.none,
icon: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.search),
), ),
suffixIcon: Icon(Icons.mic),
contentPadding: EdgeInsets.all(8),
), ),
), ),
), ),
...@@ -646,4 +694,20 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -646,4 +694,20 @@ class ClassroomViewPage extends StatelessWidget {
), ),
); );
} }
Future<String> getStudentCount() async {
try {
final QuerySnapshot<Map<String, dynamic>> snapshot =
await FirebaseFirestore.instance
.collection('students')
.where('className', isEqualTo: documents)
.get();
final int count = snapshot.size;
return count.toString();
} catch (e) {
print("Error getting student count: $e");
return '0';
}
}
} }
...@@ -309,4 +309,3 @@ class _KidsReportPageState extends State<KidsReportPage> { ...@@ -309,4 +309,3 @@ class _KidsReportPageState extends State<KidsReportPage> {
)..show(); )..show();
} }
} }
This diff is collapsed.
This diff is collapsed.
...@@ -25,7 +25,7 @@ class _LoginPage extends State<LoginPage> { ...@@ -25,7 +25,7 @@ class _LoginPage extends State<LoginPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent, backgroundColor: Colors.white,
elevation: 0, elevation: 0,
leading: IconButton( leading: IconButton(
icon: const Icon( icon: const Icon(
...@@ -135,14 +135,15 @@ class _LoginPage extends State<LoginPage> { ...@@ -135,14 +135,15 @@ class _LoginPage extends State<LoginPage> {
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
color: Colors.green, color: Colors.blueAccent,
), ),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(15.0),
child: Text( child: Text(
'Login', 'Login',
style: TextStyle(color: Colors.black), style:
TextStyle(color: Colors.white, fontSize: 16),
), ),
), ),
), ),
......
...@@ -61,14 +61,14 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -61,14 +61,14 @@ class _MyHomePageState extends State<MyHomePage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Timer.periodic(Duration(milliseconds: 500), (timer) { Timer.periodic(Duration(milliseconds: 800), (timer) {
setState(() { setState(() {
// Toggle between zoom in and zoom out // Toggle between zoom in and zoom out
scaleFactor = scaleFactor == 1.0 ? 1.05 : 1.0; scaleFactor = scaleFactor == 1.0 ? 1.05 : 1.0;
}); });
}); });
Future.delayed(Duration(seconds: 3), () { Future.delayed(Duration(seconds: 2), () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
......
...@@ -67,12 +67,12 @@ class ParentTeacherPage extends StatelessWidget { ...@@ -67,12 +67,12 @@ class ParentTeacherPage extends StatelessWidget {
child: Container( child: Container(
width: 200, width: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(8.0),
color: Color.fromARGB(220, 164, 68, 215), color: Colors.blueAccent,
), ),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(12.0),
child: Text( child: Text(
'Parent', 'Parent',
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
...@@ -100,12 +100,12 @@ class ParentTeacherPage extends StatelessWidget { ...@@ -100,12 +100,12 @@ class ParentTeacherPage extends StatelessWidget {
child: Container( child: Container(
width: 200, width: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(8.0),
color: Color.fromARGB(220, 164, 68, 215), color: Colors.blueAccent,
), ),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(12.0),
child: Text( child: Text(
'Teacher', 'Teacher',
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
......
...@@ -67,12 +67,12 @@ class ParentTeacherSignUpPage extends StatelessWidget { ...@@ -67,12 +67,12 @@ class ParentTeacherSignUpPage extends StatelessWidget {
child: Container( child: Container(
width: 200, width: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(8.0),
color: Color.fromARGB(220, 164, 68, 215), color: Colors.blueAccent,
), ),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(12.0),
child: Text( child: Text(
'Parent', 'Parent',
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
...@@ -98,12 +98,12 @@ class ParentTeacherSignUpPage extends StatelessWidget { ...@@ -98,12 +98,12 @@ class ParentTeacherSignUpPage extends StatelessWidget {
child: Container( child: Container(
width: 200, width: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(8.0),
color: Color.fromARGB(220, 164, 68, 215), color: Colors.blueAccent,
), ),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(12.0),
child: Text( child: Text(
'Teacher', 'Teacher',
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
......
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/childrenProfile.dart';
import 'package:mobile_application_kids/classroomview.dart'; import 'package:mobile_application_kids/classroomview.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/games.dart'; import 'package:mobile_application_kids/games.dart';
import 'package:mobile_application_kids/teacherchat.dart'; import 'package:mobile_application_kids/teacherchat.dart';
import 'ChatScreen.dart'; import 'ChatScreen.dart';
import 'TeacherProfile.dart'; import 'TeacherProfile.dart';
import 'childrenProfile.dart';
class ParentHomePage extends StatelessWidget { class ParentHomePage extends StatelessWidget {
late User? user; late User? user;
late final Stream<QuerySnapshot> _usersStream; late final Stream<QuerySnapshot> _usersStream;
late String phoneNo; late String phoneNo;
late String role; late String role;
ParentHomePage(param0, role) { ParentHomePage(param0, role) {
this.role = role; this.role = role;
this.phoneNo = param0; this.phoneNo = param0;
...@@ -30,6 +29,7 @@ class ParentHomePage extends StatelessWidget { ...@@ -30,6 +29,7 @@ class ParentHomePage extends StatelessWidget {
.snapshots(); .snapshots();
} }
// Define a TextStyle with the Poppins font
final TextStyle poppinsTextStyle = TextStyle( final TextStyle poppinsTextStyle = TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
); );
...@@ -38,14 +38,24 @@ class ParentHomePage extends StatelessWidget { ...@@ -38,14 +38,24 @@ class ParentHomePage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
// Disable the back button press
return false; return false;
}, },
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
// leading: Flexible(
// child: Image.asset(
// 'lib/assets/logo.png',
// fit: BoxFit.contain,
// height: 150, // Adjust the height to make the logo bigger
// ),
// ),
actions: [ actions: [
IconButton( IconButton(
icon: Icon(Icons.notifications), icon: Icon(Icons.notifications),
onPressed: () {}, onPressed: () {
// Handle notification icon press
},
), ),
], ],
), ),
...@@ -58,6 +68,7 @@ class ParentHomePage extends StatelessWidget { ...@@ -58,6 +68,7 @@ class ParentHomePage extends StatelessWidget {
Text( Text(
'Explore, learn, and play in our magical world of wonder!', 'Explore, learn, and play in our magical world of wonder!',
style: poppinsTextStyle.copyWith( style: poppinsTextStyle.copyWith(
// fontWeight: FontWeight.bold,
fontSize: 13, fontSize: 13,
), ),
), ),
...@@ -74,9 +85,11 @@ class ParentHomePage extends StatelessWidget { ...@@ -74,9 +85,11 @@ class ParentHomePage extends StatelessWidget {
children: [ children: [
TextButton( TextButton(
onPressed: () { onPressed: () {
// Navigate to the AddClassroomPage
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => AddClassroomPage()), MaterialPageRoute(
builder: (context) => AddClassroomPage()),
); );
}, },
child: Row( child: Row(
...@@ -99,6 +112,7 @@ class ParentHomePage extends StatelessWidget { ...@@ -99,6 +112,7 @@ class ParentHomePage extends StatelessWidget {
child: StreamBuilder<QuerySnapshot>( child: StreamBuilder<QuerySnapshot>(
stream: _usersStream, stream: _usersStream,
builder: (context, snapshot) { builder: (context, snapshot) {
print("--------------------------------------");
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); return CircularProgressIndicator();
} }
...@@ -106,6 +120,7 @@ class ParentHomePage extends StatelessWidget { ...@@ -106,6 +120,7 @@ class ParentHomePage extends StatelessWidget {
if (snapshot.hasError) { if (snapshot.hasError) {
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} }
var itemcount = snapshot.data!.docs.length;
return ListView.builder( return ListView.builder(
itemCount: snapshot.data!.docs.length, itemCount: snapshot.data!.docs.length,
...@@ -113,13 +128,16 @@ class ParentHomePage extends StatelessWidget { ...@@ -113,13 +128,16 @@ class ParentHomePage extends StatelessWidget {
var document = snapshot.data!.docs[index]; var document = snapshot.data!.docs[index];
var className = document['className']; var className = document['className'];
var name = document['Firstname']; var name = document['Firstname'];
print(document);
return Padding( return Padding(
padding: const EdgeInsets.only(bottom: 8.0), padding: const EdgeInsets.only(
bottom: 8.0), // Adjust the spacing as needed
child: ListTile( child: ListTile(
leading: CircleAvatar( leading: CircleAvatar(
radius: 27.0, radius: 27.0,
backgroundImage: AssetImage('lib/assets/classlogo.png'), backgroundImage:
AssetImage('lib/assets/classlogo.png'),
), ),
title: Column( title: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -153,12 +171,13 @@ class ParentHomePage extends StatelessWidget { ...@@ -153,12 +171,13 @@ class ParentHomePage extends StatelessWidget {
), ),
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
print(document);
// Handle view class button press
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ChildrenProfilePage( builder: (context) =>
document, ChildrenProfilePage(document, "P"),
),
), ),
); );
}, },
...@@ -180,6 +199,50 @@ class ParentHomePage extends StatelessWidget { ...@@ -180,6 +199,50 @@ class ParentHomePage extends StatelessWidget {
], ],
), ),
), ),
// bottomNavigationBar: BottomNavigationBar(
// items: const [
// BottomNavigationBarItem(
// icon: Icon(Icons.home),
// label: 'Home',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.chat),
// label: 'Chat',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.person),
// label: 'Profile',
// ),
// ],
// selectedItemColor: Colors.blue,
// onTap: (index) {
// // Handle bottom navigation item tap
// switch (index) {
// case 0:
// break;
// case 1:
// // Navigate to Chat
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => ChatScreen()),
// );
// break;
// case 2:
// // Navigate to Profile
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => TeacherProfilePage(
// uid: user?.uid,
// )),
// );
// break;
// }
// },
// ),
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
items: const [ items: const [
BottomNavigationBarItem( BottomNavigationBarItem(
......
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jema_app/teacherchat.dart'; import 'package:mobile_application_kids/teacherchat.dart';
import 'package:jema_app/classroomview.dart'; import 'package:mobile_application_kids/classroomview.dart';
import 'package:jema_app/addclassroom.dart'; import 'package:mobile_application_kids/addclassroom.dart';
import 'package:jema_app/teacherhome.dart'; import 'package:mobile_application_kids/teacherhome.dart';
import 'package:pie_chart/pie_chart.dart'; import 'package:pie_chart/pie_chart.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
......
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jema_app/teacherchat.dart'; import 'package:mobile_application_kids/teacherchat.dart';
import 'package:jema_app/classroomview.dart'; import 'package:mobile_application_kids/classroomview.dart';
import 'package:jema_app/addclassroom.dart'; import 'package:mobile_application_kids/addclassroom.dart';
import 'package:jema_app/teacherhome.dart'; import 'package:mobile_application_kids/teacherhome.dart';
import 'package:pie_chart/pie_chart.dart'; import 'package:pie_chart/pie_chart.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
......
...@@ -49,12 +49,12 @@ class SignInUpPage extends StatelessWidget { ...@@ -49,12 +49,12 @@ class SignInUpPage extends StatelessWidget {
child: Container( child: Container(
width: 200, width: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(8.0),
color: Color.fromARGB(255, 96, 188, 99), color: Color.fromARGB(255, 96, 188, 99),
), ),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(12.0),
child: Text( child: Text(
'Sign Up', 'Sign Up',
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
...@@ -83,12 +83,12 @@ class SignInUpPage extends StatelessWidget { ...@@ -83,12 +83,12 @@ class SignInUpPage extends StatelessWidget {
child: Container( child: Container(
width: 200, width: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(8.0),
color: const Color.fromARGB(255, 213, 80, 236), color: Colors.blueAccent,
), ),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(12.0),
child: Text( child: Text(
'Sign In', 'Sign In',
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
......
...@@ -97,10 +97,10 @@ class TeacherHomePage extends StatelessWidget { ...@@ -97,10 +97,10 @@ class TeacherHomePage extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(left: 8.0), margin: EdgeInsets.only(left: 20.0),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.fromARGB(203, 164, 88, 177), color: Colors.blueAccent,
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
), ),
child: Icon( child: Icon(
...@@ -118,7 +118,7 @@ class TeacherHomePage extends StatelessWidget { ...@@ -118,7 +118,7 @@ class TeacherHomePage extends StatelessWidget {
Text( Text(
'Class Rooms', 'Class Rooms',
style: poppinsTextStyle.copyWith( style: poppinsTextStyle.copyWith(
fontSize: 16, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
...@@ -169,18 +169,18 @@ class TeacherHomePage extends StatelessWidget { ...@@ -169,18 +169,18 @@ class TeacherHomePage extends StatelessWidget {
Text( Text(
'Class $index', 'Class $index',
style: poppinsTextStyle.copyWith( style: poppinsTextStyle.copyWith(
fontSize: 12.0), fontSize: 14.0),
), ),
], ],
), ),
], ],
), ),
trailing: Container( trailing: Container(
height: 35.0, height: 40.0,
width: 80.0, width: 100.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.fromARGB(203, 164, 88, 177), color: Colors.blueAccent,
borderRadius: BorderRadius.circular(4.0), borderRadius: BorderRadius.circular(8.0),
), ),
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
......
name: jema_app name: mobile_application_kids
description: A new Flutter project. description: A new Flutter project.
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages. # pub.dev using `flutter pub publish`. This is preferred for private packages.
...@@ -96,6 +96,8 @@ flutter: ...@@ -96,6 +96,8 @@ flutter:
- lib/assets/ac4.png - lib/assets/ac4.png
- lib/assets/ac5.png - lib/assets/ac5.png
- lib/assets/banner.png - lib/assets/banner.png
- lib/assets/ac6.png
- lib/assets/ac7.png
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment