Commit b4eb8f7b authored by Uditha Prabhasha 's avatar Uditha Prabhasha

final update

parent 985775c7
......@@ -43,6 +43,12 @@
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "carousel_slider",
"rootUri": "file:///Users/avishkanew/.pub-cache/hosted/pub.dev/carousel_slider-4.2.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "characters",
"rootUri": "file:///Users/avishkanew/.pub-cache/hosted/pub.dev/characters-1.3.0",
......@@ -686,7 +692,7 @@
"languageVersion": "3.0"
}
],
"generated": "2024-03-18T12:13:20.503381Z",
"generated": "2024-03-18T20:49:16.239934Z",
"generator": "pub",
"generatorVersion": "3.0.1"
}
......@@ -42,6 +42,10 @@ cached_network_image_web
3.0
file:///Users/avishkanew/.pub-cache/hosted/pub.dev/cached_network_image_web-1.1.1/
file:///Users/avishkanew/.pub-cache/hosted/pub.dev/cached_network_image_web-1.1.1/lib/
carousel_slider
2.12
file:///Users/avishkanew/.pub-cache/hosted/pub.dev/carousel_slider-4.2.1/
file:///Users/avishkanew/.pub-cache/hosted/pub.dev/carousel_slider-4.2.1/lib/
characters
2.12
file:///Users/avishkanew/.pub-cache/hosted/pub.dev/characters-1.3.0/
......
This diff is collapsed.
// 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
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;
......@@ -12,16 +11,37 @@ class UserActivitiesScreen extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('User Activities'),
title: Text(' '),
actions: [
Container(
alignment: Alignment.centerRight,
padding: EdgeInsets.only(right: 16),
child: Text(
'Activities',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
body: StreamBuilder<QuerySnapshot>(
),
),
],
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: StreamBuilder<QuerySnapshot>(
stream: FirebaseFirestore.instance
.collection('activities')
.where('user', isEqualTo: userId)
.snapshots(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); // Loading indicator
return Center(
child:
CircularProgressIndicator()); // Loading indicator
}
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}'); // Error handling
......@@ -32,70 +52,113 @@ class UserActivitiesScreen extends StatelessWidget {
); // No activities found
}
return ListView(
children: snapshot.data!.docs.map((document) {
final videoUrl = document['videoUrl'];
final imageUrl = document['imageUrl'];
final imageDocs = snapshot.data!.docs
.where((doc) => doc['imageUrl'] != null)
.toList();
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(),
return ImageWall(
imageDocs: imageDocs,
);
},
),
),
);
}
}
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
}
},
class ImageWall extends StatelessWidget {
final List<DocumentSnapshot> imageDocs;
ImageWall({required this.imageDocs});
@override
Widget build(BuildContext context) {
// Sort the imageDocs based on timestamp in descending order
imageDocs.sort((a, b) => b['timestamp'].compareTo(a['timestamp']));
return ListView.separated(
itemCount: imageDocs.length,
itemBuilder: (context, index) {
final imageUrl = imageDocs[index]['imageUrl'];
final timestamp = imageDocs[index]['timestamp'];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: ImageItem(
imageUrl: imageUrl,
timestamp: timestamp,
),
onTap: () {
// Handle tap, e.g., navigate to a detail screen
);
},
separatorBuilder: (context, index) => SizedBox(height: 16.0),
);
}
}
class ImageItem extends StatelessWidget {
final String imageUrl;
final Timestamp timestamp;
final double imageHeight = 200.0;
ImageItem({required this.imageUrl, required this.timestamp});
Widget _buildImageItem(String imageUrl) {
return ListTile(
title: Text('Activity Image'),
leading: CachedNetworkImage(
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
height: imageHeight,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0), // Rounded corners
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: Offset(0, 2), // Drop shadow
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(16.0), // Clip rounded corners
child: CachedNetworkImage(
imageUrl: imageUrl,
placeholder: (context, url) =>
CircularProgressIndicator(), // Placeholder while image loads
fit: BoxFit.cover,
placeholder: (context, url) => Center(
child: CircularProgressIndicator(),
),
errorWidget: (context, url, error) => Icon(Icons.error),
),
onTap: () {
// Handle tap, e.g., navigate to a detail screen
),
),
Container(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.7), // Semi-transparent background
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(16.0), // Round only bottom corners
bottomRight: Radius.circular(16.0),
),
),
child: Row(
children: [
Expanded(
child: Text(
'Uploaded: ${timestamp.toDate()}',
style: TextStyle(color: Colors.white),
),
),
IconButton(
icon: Icon(Icons.date_range),
color: Colors.white,
onPressed: () {
},
),
],
),
),
],
);
}
}
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:cached_network_image/cached_network_image.dart';
class pUserActivitiesScreen extends StatelessWidget {
final String pUser;
pUserActivitiesScreen({required this.pUser});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(' '),
actions: [
Container(
alignment: Alignment.centerRight,
padding: EdgeInsets.only(right: 16),
child: Text(
'Activities',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
),
),
],
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: StreamBuilder<QuerySnapshot>(
stream: FirebaseFirestore.instance
.collection('activities')
// .where('pUser', isEqualTo: pUser)
.snapshots(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child:
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
}
final imageDocs = snapshot.data!.docs
.where((doc) => doc['imageUrl'] != null)
.toList();
return ImageWall(
imageDocs: imageDocs,
);
},
),
),
);
}
}
class ImageWall extends StatelessWidget {
final List<DocumentSnapshot> imageDocs;
ImageWall({required this.imageDocs});
@override
Widget build(BuildContext context) {
// Sort the imageDocs based on timestamp in descending order
imageDocs.sort((a, b) => b['timestamp'].compareTo(a['timestamp']));
return ListView.separated(
itemCount: imageDocs.length,
itemBuilder: (context, index) {
final imageUrl = imageDocs[index]['imageUrl'];
final timestamp = imageDocs[index]['timestamp'];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: ImageItem(
imageUrl: imageUrl,
timestamp: timestamp,
),
);
},
separatorBuilder: (context, index) => SizedBox(height: 16.0),
);
}
}
class ImageItem extends StatelessWidget {
final String imageUrl;
final Timestamp timestamp;
final double imageHeight = 200.0;
ImageItem({required this.imageUrl, required this.timestamp});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
height: imageHeight,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0), // Rounded corners
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: Offset(0, 2), // Drop shadow
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(16.0), // Clip rounded corners
child: CachedNetworkImage(
imageUrl: imageUrl,
fit: BoxFit.cover,
placeholder: (context, url) => Center(
child: CircularProgressIndicator(),
),
errorWidget: (context, url, error) => Icon(Icons.error),
),
),
),
Container(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.7), // Semi-transparent background
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(16.0), // Round only bottom corners
bottomRight: Radius.circular(16.0),
),
),
child: Row(
children: [
Expanded(
child: Text(
'Uploaded: ${timestamp.toDate()}',
style: TextStyle(color: Colors.white),
),
),
IconButton(
icon: Icon(Icons.date_range),
color: Colors.white,
onPressed: () {
// Implement your comment functionality here
// You can navigate to a comment screen or show a dialog
// to add comments for the current image.
},
),
],
),
),
],
);
}
}
This diff is collapsed.
......@@ -273,11 +273,13 @@ class ChildrenActivity extends StatelessWidget {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChildrenActiPhone(image: imagePath)),
builder: (context) => ChildrenActiPhone(
image: imagePath,
// userId: user?.uid, // Pass the user ID to the next screen
),
),
);
// Use the picked file, for example, display it in an Image widget
// Image.file(File(pickedFile.path))
print('Image selected: ${pickedFile.path}');
} else {
print('No image selected');
......@@ -289,15 +291,17 @@ class ChildrenActivity extends StatelessWidget {
final pickedFile = await picker.pickVideo(source: ImageSource.camera);
if (pickedFile != null) {
String imagePath = pickedFile.path;
String videoPath = pickedFile.path;
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChildrenVideo(video: imagePath)),
builder: (context) => ChildrenVideo(
video: videoPath,
// userId: user?.uid, // Pass the user ID to the next screen
),
),
);
// Use the picked file, for example, display it in a Video widget
// Video.file(File(pickedFile.path))
print('Video selected: ${pickedFile.path}');
} else {
print('No video selected');
......
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:mobile_application_kids/ActivitiesView_parent.dart';
import 'package:mobile_application_kids/progressReport.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'package:mobile_application_kids/classroomview.dart';
......@@ -19,7 +20,7 @@ class pChildrenProfilePage extends StatelessWidget {
int _age = 10;
String role = '';
late final userDetails;
pChildrenProfilePage(document, role) {
pChildrenProfilePage(document, role, {required String pUser}) {
print(role);
this.role = role;
this.userDetails = document;
......@@ -477,8 +478,8 @@ class pChildrenProfilePage extends StatelessWidget {
context,
MaterialPageRoute(
builder: (context) =>
UserActivitiesScreen(
userId: user!.uid)),
pUserActivitiesScreen(pUser: user!.uid)
)
);
},
child: Container(
......@@ -738,7 +739,7 @@ class pChildrenProfilePage extends StatelessWidget {
TextSpan(
children: [
TextSpan(
text: 'Monthly \npsycholo. report \n ',
text: 'Monthly progress report \n',
style: TextStyle(
color:
Color(0xFF403572),
......@@ -760,7 +761,7 @@ class pChildrenProfilePage extends StatelessWidget {
child: Opacity(
opacity: 0.70,
child: Text(
'Some short description of this type of report.',
"Progress of kid's learning and behavior",
style: TextStyle(
color: Color(0xFF8DAEAE),
fontSize: 9.55,
......@@ -847,7 +848,7 @@ class pChildrenProfilePage extends StatelessWidget {
TextSpan(
children: [
TextSpan(
text: 'Monthly prediction report \n',
text: 'Monthly \nPsychology Report \n',
style: TextStyle(
color:
Color(0xFF479696),
......@@ -868,7 +869,7 @@ class pChildrenProfilePage extends StatelessWidget {
child: Opacity(
opacity: 0.70,
child: Text(
'Some short description of this type of report.',
'Monthly insights of activity reports',
style: TextStyle(
color: Color(0xFF8DAEAE),
fontSize: 9.55,
......
......@@ -5,6 +5,8 @@ import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'dart:io';
import 'package:intl/intl.dart';
class AddStudentPage extends StatefulWidget {
const AddStudentPage({required this.classname});
......@@ -17,6 +19,7 @@ class AddStudentPage extends StatefulWidget {
class _AddStudentState extends State<AddStudentPage> {
final _formkey = GlobalKey<FormState>();
final _auth = FirebaseAuth.instance;
//Bio Part
TextEditingController _firstnameController = TextEditingController();
TextEditingController _lastnameController = TextEditingController();
......@@ -50,6 +53,9 @@ class _AddStudentState extends State<AddStudentPage> {
XFile? _selectedImage;
String classname;
String? _selectedSex;
DateTime? _selectedBirthday;
_AddStudentState(String classname) : this.classname = classname;
@override
......@@ -163,6 +169,31 @@ 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),
Container(
height: 55.0,
......@@ -186,25 +217,34 @@ class _AddStudentState extends State<AddStudentPage> {
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _sexController,
decoration: InputDecoration(
hintText: 'Male/Female',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
decoration: BoxDecoration(
color: Color.fromARGB(107, 196, 196, 196), // Background color
borderRadius: BorderRadius.circular(10.0), // Border radius
),
suffixIcon: Icon(Icons.people,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0), // Add border here
child: DropdownButtonFormField<String>(
value: _selectedSex, // This should be a variable in your state class initialized to null or the default value
decoration: InputDecoration(
border: InputBorder.none,
// contentPadding: EdgeInsets.zero,
suffixIcon: Icon(Icons.people, size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
),
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
SizedBox(height: 50),
Row(
children: [
......@@ -586,7 +626,7 @@ class _AddStudentState extends State<AddStudentPage> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
ElevatedButton(
onPressed: () async {
if (Image == null) {
AwesomeDialog(
......@@ -664,36 +704,38 @@ class _AddStudentState extends State<AddStudentPage> {
}
},
style:
TextButton.styleFrom(backgroundColor: Colors.green),
ElevatedButton.styleFrom(
primary: const Color.fromARGB(255, 48, 206, 53),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Text(
'Save',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 1,
style: TextStyle(color: const Color.fromARGB(255, 255, 255, 255)),
),
),
),
TextButton(
ElevatedButton(
onPressed: () {
// Handle signup logic here
Navigator.pop(context);
},
style: TextButton.styleFrom(
backgroundColor: Colors.grey.shade200),
style: ElevatedButton.styleFrom(
primary: const Color.fromARGB(255, 255, 255, 255),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Text(
'Cancel',
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 1,
style: TextStyle(color: Colors.black),
),
),
),
)
],
),
],
......@@ -766,3 +808,18 @@ class _AddStudentState extends State<AddStudentPage> {
)..show();
}
}
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);
// });
// }
}
This diff is collapsed.
......@@ -738,7 +738,7 @@ child: Container(
TextSpan(
children: [
TextSpan(
text: 'Monthly \npsycholo. report \n ',
text: 'Monthly progress report \n',
style: TextStyle(
color:
Color(0xFF403572),
......@@ -760,7 +760,7 @@ child: Container(
child: Opacity(
opacity: 0.70,
child: Text(
'Some short description of this type of report.',
"Progress of kid's learning and behavior.",
style: TextStyle(
color: Color(0xFF8DAEAE),
fontSize: 9.55,
......@@ -847,7 +847,7 @@ child: Container(
TextSpan(
children: [
TextSpan(
text: 'Monthly prediction report \n',
text: 'Monthly \nPsychology Report \n ',
style: TextStyle(
color:
Color(0xFF479696),
......@@ -868,7 +868,7 @@ child: Container(
child: Opacity(
opacity: 0.70,
child: Text(
'Some short description of this type of report.',
'Monthly insights of activity reports',
style: TextStyle(
color: Color(0xFF8DAEAE),
fontSize: 9.55,
......
......@@ -125,7 +125,7 @@ class ClassroomViewPage extends StatelessWidget {
}
// Use the result of getStudentCount
return Text(
'Children Count ' + (snapshot.data ?? '0'), // Default to '0' if data is null
'Kids Count: ' + (snapshot.data ?? '0'), // Default to '0' if data is null
style: TextStyle(
color: Colors.black,
fontSize: 15,
......
import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:mobile_application_kids/ChatScreen.dart';
import 'package:mobile_application_kids/parentHome.dart';
import 'package:mobile_application_kids/parentProfile.dart';
class GamesPage extends StatelessWidget {
final List<Map<String, String>> gameData = [
{'game': 'Game 1', 'description': 'Description for Game 1'},
{'game': 'Game 2', 'description': 'Description for Game 2'},
// add list
{'game': 'Game 3', 'description': 'Description for Game 1'},
{'game': 'Game 4', 'description': 'Description for Game 2'},
// add more games as needed
];
final String commonImagePath = 'assets/act_photo.png';
final String commonImagePath = 'lib/assets/act_photo.png';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Games'),
title: Text(' '),
actions: [
Container(
alignment: Alignment.centerRight,
padding: EdgeInsets.only(right: 16),
child: Text(
'Games',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
),
),
],
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -69,7 +93,7 @@ class GamesPage extends StatelessWidget {
label: 'Chat',
),
BottomNavigationBarItem(
icon: Icon(Icons.games),
icon: Icon(Icons.sports_baseball),
label: 'Games',
),
BottomNavigationBarItem(
......@@ -77,36 +101,35 @@ class GamesPage extends StatelessWidget {
label: 'Profile',
),
],
selectedItemColor: Color(0xFF7A1FA0),
unselectedItemColor: Color(0xFFA9ABAD),
selectedLabelStyle: TextStyle(color: Color(0xFF7A1FA0)),
unselectedLabelStyle: TextStyle(color: Color.fromARGB(0, 197, 16, 16)),
selectedItemColor: Colors.blueAccent,
unselectedItemColor: Colors.grey,
currentIndex: 2,
onTap: (index) {
switch (index) {
case 0:
// Navigate to Home
// Replace the code below with your home navigation logic
// Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => AddClassroom()),
// context,
// MaterialPageRoute(builder: (context) => ParentHomePage(phoneNo, role)),
// );
break;
case 1:
// Navigate to Chat
// Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => ChatScreen()),
// );
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ChatScreen()),
);
break;
case 2:
// Already on Games Page
// Do nothing, we are already on the Games page
break;
case 3:
// Navigate to Profile
// Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => TeacherProfile()),
// context,
// MaterialPageRoute(
// builder: (context) => ParentProfilePage(uid: uid, phoneNo: phoneNo, role: role),
// ),
// );
break;
}
......
......@@ -172,7 +172,8 @@ class _KidsReportPageState extends State<KidsReportPage> {
padding: const EdgeInsets.all(10.0),
child: Text(
'Save',
style: TextStyle(color: const Color.fromARGB(255, 255, 255, 255)),
style: TextStyle(
color: const Color.fromARGB(255, 255, 255, 255)),
),
),
),
......
......@@ -20,7 +20,24 @@ class ReportKidsViewPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Student Report'),
title: Text(' '),
actions: [
Container(
alignment: Alignment.centerRight,
padding: EdgeInsets.only(right: 16),
child: Text(
'Student Report',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
),
),
],
),
body: StreamBuilder<QuerySnapshot>(
stream: _reportsStream,
......@@ -55,9 +72,9 @@ Widget _buildReportItem(String title, Map<String, dynamic> data) {
data.remove('sId');
return Card(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
child: Padding(
padding: EdgeInsets.all(16),
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
......@@ -80,7 +97,7 @@ Widget _buildReportItem(String title, Map<String, dynamic> data) {
Text(
entry.key,
style: TextStyle(
fontWeight: FontWeight.bold,
// fontWeight: FontWeight.bold,
),
),
Text(entry.value ?? 'Not provided'),
......
......@@ -33,7 +33,7 @@ class KidsReportsPage extends StatelessWidget {
// letterSpacing: -0.96,
// ),
// ),
SizedBox(height: 20), // Add space here
SizedBox(height: 20),
Text(
'Select Kids ',
style: TextStyle(
......
......@@ -192,7 +192,7 @@ class _LoginPage extends State<LoginPage> {
} else {
AwesomeDialog(
context: context,
dialogType: DialogType.info,
dialogType: DialogType.success,
animType: AnimType.rightSlide,
title: ' login Parent',
desc: ' Go to your parent home page',
......
......@@ -186,7 +186,7 @@ class ParentHomePage extends StatelessWidget {
context,
MaterialPageRoute(
builder: (context) =>
pChildrenProfilePage(document, "P"),
pChildrenProfilePage(document, "P", pUser: 'user',),
),
);
},
......@@ -253,7 +253,6 @@ class ParentHomePage extends StatelessWidget {
context,
MaterialPageRoute(builder: (context) => GamesPage()),
);
break;
case 3:
// Navigate to Profile
......
......@@ -2,6 +2,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:mobile_application_kids/ChatScreen.dart';
import 'package:mobile_application_kids/games.dart';
import 'package:mobile_application_kids/p_or_t.dart';
import 'package:mobile_application_kids/parenthome.dart';
......@@ -169,25 +170,46 @@ class _ParentProfilePageState extends State<ParentProfilePage> {
icon: Icon(Icons.chat),
label: 'Chat',
),
BottomNavigationBarItem(
icon: Icon(Icons.sports_baseball),
label: 'Games',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profile',
),
],
selectedItemColor: Colors.blue,
currentIndex: 2,
selectedItemColor: Colors.blueAccent,
unselectedItemColor: Colors.grey,
currentIndex: 3,
onTap: (index) {
if (index == 0) {
switch (index) {
case 0:
// Navigate to Home
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ParentHomePage(phoneNo, role)),
);
}
if (index == 1) {
break;
case 1:
// Navigate to Chat
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ChatScreen()),
);
break;
case 2:
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => GamesPage(),
),
);
break;
case 3:
// Navigate to Profile
// Do nothing, we are already on the Games page
break;
}
},
),
......
......@@ -32,7 +32,23 @@ class _ParentSignupPageState extends State<ParentSignupPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Parent Signup'),
title: Text(' '),
actions: [
Container(
alignment: Alignment.centerRight,
padding: EdgeInsets.only(right: 16),
child: Text('Parent Register',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
),
),
],
),
body: SingleChildScrollView(
child: Column(
......@@ -73,15 +89,39 @@ class _ParentSignupPageState extends State<ParentSignupPage> {
obscureText: true,
),
const SizedBox(height: 20),
ElevatedButton(
Center(
child: ElevatedButton(
onPressed: () {
// Logic to navigate to the next page with additional information
signUp(emailController.text, passwordController.text,
'parent', context);
signUp(emailController.text, passwordController.text, 'parent', context);
},
child: Text('Finish'),
style: ElevatedButton.styleFrom(
primary: Color.fromARGB(255, 48, 206, 53), // Note: 'const' was removed for consistency
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
),
child: Padding(
padding: EdgeInsets.all(12.0), // Note: 'const' was removed for consistency
child: Text(
'Finish',
style: TextStyle(
color: Color.fromARGB(255, 255, 255, 255), // Note: 'const' was removed for consistency
),
),
),
),
)
// ElevatedButton(
// onPressed: () {
// // Logic to navigate to the next page with additional information
// signUp(emailController.text, passwordController.text,
// 'parent', context);
// },
// child: Text('Finish'),
// ),
],
),
),
......
......@@ -148,6 +148,7 @@ class TeacherHomePage extends StatelessWidget {
itemBuilder: (context, index) {
var document = snapshot.data!.docs[index];
var className = document['className'];
print(document);
return Padding(
padding: const EdgeInsets.only(
......@@ -173,7 +174,7 @@ class TeacherHomePage extends StatelessWidget {
Row(
children: [
Text(
'Class $index',
'Class ${index + 1}',
style: poppinsTextStyle.copyWith(
fontSize: 14.0),
),
......
......@@ -30,7 +30,23 @@ class _TeacherSignupPageState extends State<TeacherSignupPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Teacher Signup'),
title: Text(' '),
actions: [
Container(
alignment: Alignment.centerRight,
padding: EdgeInsets.only(right: 16),
child: Text('Teacher Register',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
),
),
],
),
body: SingleChildScrollView(
child: Column(
......@@ -71,7 +87,8 @@ class _TeacherSignupPageState extends State<TeacherSignupPage> {
obscureText: true,
),
const SizedBox(height: 20),
ElevatedButton(
Center(
child:ElevatedButton(
onPressed: () {
// Logic to navigate to the next page with additional information
Navigator.push(
......@@ -87,8 +104,20 @@ class _TeacherSignupPageState extends State<TeacherSignupPage> {
),
);
},
child: Text('Next'),
style: ElevatedButton.styleFrom(
primary: Color.fromARGB(255, 48, 206, 53), // Green background color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), // Rounded corners
),
padding: EdgeInsets.all(12.0), // Padding inside the button
),
child: Text(
'Next',
style: TextStyle(
color: Color.fromARGB(255, 255, 255, 255), // White text color
),
),
),),
],
),
),
......@@ -157,7 +186,23 @@ class AdditionalInfoPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Additional Information'),
title: Text(' '),
actions: [
Container(
alignment: Alignment.centerRight,
padding: EdgeInsets.only(right: 16),
child: Text('Additional Information',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
),
),
],
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
......@@ -200,20 +245,38 @@ class AdditionalInfoPage extends StatelessWidget {
// },
// ),
Text(
'By checking the box you agree to our Terms and Conditions.',
'By finishing the form you agree to our Terms and Conditions.',
style: TextStyle(fontSize: 12),
),
],
),
const SizedBox(height: 20),
ElevatedButton(
const SizedBox(height: 12),
Align(
alignment: Alignment.center, // Align the button to the right
child: Container(
height: 48.0, // Reduced height
child: ElevatedButton(
onPressed: () {
// Logic to finish the teacher registration
signUp(emailController.text, passwordController.text, rool,
context);
signUp(emailController.text, passwordController.text, rool, context);
},
child: Text('Finish'),
style: ElevatedButton.styleFrom(
primary: Color.fromARGB(255, 48, 206, 53), // Green background color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), // Rounded corners
),
padding: EdgeInsets.symmetric(horizontal: 10.0), // Reduced padding
),
child: Text(
'Finish',
style: TextStyle(
color: Color.fromARGB(255, 255, 255, 255), // White text color
fontSize: 14, // Reduced font size to accommodate the reduced button height
),
),
),
),
)
],
),
),
......
......@@ -57,6 +57,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.1"
carousel_slider:
dependency: "direct main"
description:
name: carousel_slider
sha256: "9c695cc963bf1d04a47bd6021f68befce8970bcd61d24938e1fb0918cf5d9c42"
url: "https://pub.dev"
source: hosted
version: "4.2.1"
characters:
dependency: transitive
description:
......@@ -417,7 +425,7 @@ packages:
source: hosted
version: "0.2.1+1"
intl:
dependency: transitive
dependency: "direct main"
description:
name: intl
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
......
......@@ -47,7 +47,9 @@ dependencies:
url_launcher: ^6.1.14
cached_network_image: ^3.3.1
charts_flutter: ^0.12.0
table_calendar: ^3.0.8
table_calendar: ^3.0.3
carousel_slider: ^4.0.0
intl: ^0.17.0
dev_dependencies:
......@@ -99,6 +101,13 @@ flutter:
- lib/assets/banner.png
- lib/assets/ac6.png
- lib/assets/ac7.png
- lib/assets/parentprofile.JPG
- lib/assets/parentprof.PNG
- lib/assets/teacherprof.png
- lib/assets/I.png
- lib/assets/i2.png
- lib/assets/act_photo.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