Commit 21c8d902 authored by Uditha Prabhasha 's avatar Uditha Prabhasha

new updates

parent 47ccb2f3
......@@ -9,8 +9,12 @@
import 'package:cloud_firestore_web/cloud_firestore_web.dart';
import 'package:firebase_auth_web/firebase_auth_web.dart';
import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:firebase_storage_web/firebase_storage_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:rive_common/rive_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:video_player_web/video_player_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
void registerPlugins([final Registrar? pluginRegistrar]) {
......@@ -18,7 +22,11 @@ void registerPlugins([final Registrar? pluginRegistrar]) {
FirebaseFirestoreWeb.registerWith(registrar);
FirebaseAuthWeb.registerWith(registrar);
FirebaseCoreWeb.registerWith(registrar);
FirebaseStorageWeb.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar);
RivePlugin.registerWith(registrar);
SharedPreferencesPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
VideoPlayerPlugin.registerWith(registrar);
registrar.registerMessageHandler();
}
This diff is collapsed.
This diff is collapsed.
......@@ -8,12 +8,37 @@ firebase_auth=/Users/avishkanew/.pub-cache/hosted/pub.dev/firebase_auth-4.15.3/
firebase_auth_web=/Users/avishkanew/.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.12/
firebase_core=/Users/avishkanew/.pub-cache/hosted/pub.dev/firebase_core-2.24.2/
firebase_core_web=/Users/avishkanew/.pub-cache/hosted/pub.dev/firebase_core_web-2.10.0/
firebase_storage=/Users/avishkanew/.pub-cache/hosted/pub.dev/firebase_storage-11.6.0/
firebase_storage_web=/Users/avishkanew/.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.17/
flutter_plugin_android_lifecycle=/Users/avishkanew/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.17/
image_picker=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker-0.8.9/
image_picker=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker-1.0.7/
image_picker_android=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker_android-0.8.9+3/
image_picker_for_web=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker_for_web-2.2.0/
image_picker_ios=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.9/
image_picker_ios=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.9+1/
image_picker_linux=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/
image_picker_macos=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+1/
image_picker_windows=/Users/avishkanew/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/
path_provider=/Users/avishkanew/.pub-cache/hosted/pub.dev/path_provider-2.1.2/
path_provider_android=/Users/avishkanew/.pub-cache/hosted/pub.dev/path_provider_android-2.2.2/
path_provider_foundation=/Users/avishkanew/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/
path_provider_linux=/Users/avishkanew/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/avishkanew/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/
rive_common=/Users/avishkanew/.pub-cache/hosted/pub.dev/rive_common-0.2.7/
shared_preferences=/Users/avishkanew/.pub-cache/hosted/pub.dev/shared_preferences-2.2.2/
shared_preferences_android=/Users/avishkanew/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/
shared_preferences_foundation=/Users/avishkanew/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/
shared_preferences_linux=/Users/avishkanew/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/
shared_preferences_web=/Users/avishkanew/.pub-cache/hosted/pub.dev/shared_preferences_web-2.2.1/
shared_preferences_windows=/Users/avishkanew/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/
sqflite=/Users/avishkanew/.pub-cache/hosted/pub.dev/sqflite-2.3.2/
url_launcher=/Users/avishkanew/.pub-cache/hosted/pub.dev/url_launcher-6.1.14/
url_launcher_android=/Users/avishkanew/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.0/
url_launcher_ios=/Users/avishkanew/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.4/
url_launcher_linux=/Users/avishkanew/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/
url_launcher_macos=/Users/avishkanew/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/
url_launcher_web=/Users/avishkanew/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.19/
url_launcher_windows=/Users/avishkanew/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/
video_player=/Users/avishkanew/.pub-cache/hosted/pub.dev/video_player-2.7.2/
video_player_android=/Users/avishkanew/.pub-cache/hosted/pub.dev/video_player_android-2.4.11/
video_player_avfoundation=/Users/avishkanew/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.4.11/
video_player_web=/Users/avishkanew/.pub-cache/hosted/pub.dev/video_player_web-2.0.17/
This diff is collapsed.
This contains all the project files of Student Monitoring system
\ No newline at end of file
# mobile_application_kids
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
......@@ -13,8 +13,7 @@ linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
......
File added
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
},
);
}
}
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/teacherchat.dart';
import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart';
import 'package:jema_app/teacherhome.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'package:mobile_application_kids/classroomview.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/teacherhome.dart';
import 'package:pie_chart/pie_chart.dart';
import 'package:shared_preferences/shared_preferences.dart';
......@@ -59,7 +59,7 @@ class _AttendanceState extends State<Attendance> {
),
actions: [
Text(
'Attendance',
'Attendance ',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
......
......@@ -18,11 +18,19 @@ class _ChatScreenState extends State<ChatScreen> {
late User? _user;
File? _imageFile;
String? _voiceFilePath;
String? _username;
@override
void initState() {
super.initState();
_user = _auth.currentUser;
fetchFullName(_user!.uid).then((fullName) {
if (fullName != null) {
_username = fullName;
} else {
print('No such document');
}
});
}
void _sendMessage() async {
......@@ -43,6 +51,15 @@ class _ChatScreenState extends State<ChatScreen> {
if (_voiceFilePath != null) {
voiceUrl = await _uploadFile(File(_voiceFilePath!));
}
CollectionReference ref =
FirebaseFirestore.instance.collection('users');
DocumentSnapshot snapshot = await ref.doc(_user!.uid).get();
if (snapshot.exists) {
_username = (snapshot.data() as Map<String, dynamic>)['fullName'];
} else {
return null;
}
await _firestore.collection('messages').add({
'text': message,
......@@ -50,6 +67,7 @@ class _ChatScreenState extends State<ChatScreen> {
'user': _user!.uid,
'imageUrl': imageUrl,
'voiceUrl': voiceUrl,
'userName': _username
});
_imageFile = null;
......@@ -75,7 +93,7 @@ class _ChatScreenState extends State<ChatScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Chat'),
title: Text('Chat '),
),
body: Column(
children: <Widget>[
......@@ -105,13 +123,15 @@ class _ChatScreenState extends State<ChatScreen> {
as Map<String, dynamic>)['imageUrl'] as String?;
String? voiceUrl = (message.data()
as Map<String, dynamic>)['voiceUrl'] as String?;
String? __username = (message.data()
as Map<String, dynamic>)['userName'] as String?;
return MessageBubble(
message: text ?? '',
imageUrl: imageUrl,
voiceUrl: voiceUrl,
isCurrentUser: isCurrentUser,
);
message: text ?? '',
imageUrl: imageUrl,
voiceUrl: voiceUrl,
isCurrentUser: isCurrentUser,
userName: __username!);
},
);
},
......@@ -152,6 +172,22 @@ class _ChatScreenState extends State<ChatScreen> {
),
);
}
Future<String?> getFullNameByUid(String uid) async {
CollectionReference ref = FirebaseFirestore.instance.collection('users');
DocumentSnapshot snapshot = await ref.doc(uid).get();
if (snapshot.exists) {
return (snapshot.data() as Map<String, dynamic>)['fullName'];
} else {
return null;
}
}
Future<String?> fetchFullName(String uid) async {
String? fullName = await getFullNameByUid(_user!.uid);
return fullName;
}
}
class MessageBubble extends StatelessWidget {
......@@ -159,6 +195,7 @@ class MessageBubble extends StatelessWidget {
final String? imageUrl;
final String? voiceUrl;
final bool isCurrentUser;
final String userName;
const MessageBubble({
Key? key,
......@@ -166,6 +203,7 @@ class MessageBubble extends StatelessWidget {
required this.isCurrentUser,
this.imageUrl,
this.voiceUrl,
required this.userName,
}) : super(key: key);
@override
......@@ -191,6 +229,13 @@ class MessageBubble extends StatelessWidget {
width: 200,
),
if (message.isNotEmpty) Text(message),
Text(
userName,
style: TextStyle(
color: Color.fromARGB(255, 248, 4, 4),
fontSize: 8,
),
)
],
),
),
......
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/ChatScreen.dart';
import 'package:jema_app/teacherchat.dart';
import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart';
import 'package:jema_app/teacherhome.dart';
import 'package:mobile_application_kids/ChatScreen.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'package:mobile_application_kids/classroomview.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/teacherhome.dart';
import 'TeacherProfile.dart';
......@@ -41,7 +41,7 @@ class CheckKidsPage extends StatelessWidget {
),
actions: [
Text(
'Check In / Out',
'Check In / Out ',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
......@@ -158,9 +158,9 @@ class CheckKidsPage extends StatelessWidget {
decoration: ShapeDecoration(
color: isCheck == 1
? Color.fromARGB(
72, 219, 219, 219)
71, 228, 11, 11)
: Color.fromARGB(
71, 218, 49, 11),
70, 70, 218, 11),
shape: OvalBorder(),
),
),
......
......@@ -6,11 +6,11 @@ import 'package:cross_file/src/types/interface.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/ChatScreen.dart';
import 'package:jema_app/teacherchat.dart';
import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart';
import 'package:jema_app/teacherhome.dart';
import 'package:mobile_application_kids/ChatScreen.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'package:mobile_application_kids/classroomview.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/teacherhome.dart';
import 'TeacherProfile.dart';
......
......@@ -4,9 +4,9 @@ import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:jema_app/Attendance.dart';
import 'package:jema_app/ChildrenVideo.dart';
import 'package:jema_app/ReportKids.dart';
import 'package:mobile_application_kids/Attendance.dart';
import 'package:mobile_application_kids/ChildrenVideo.dart';
import 'package:mobile_application_kids/ReportKids.dart';
import 'CheckKids.dart';
import 'ChildrenActiPhone.dart';
import 'ChildrenHomePage.dart';
......@@ -31,6 +31,7 @@ class ChildrenActivity extends StatelessWidget {
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return Scaffold(
appBar: AppBar(
leading: IconButton(
......@@ -60,7 +61,7 @@ class ChildrenActivity extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(20, 40, 20, 20),
padding: EdgeInsets.fromLTRB(width * 0.1, 20, width * 0.1, 20),
child: Container(
width: 293,
height: 44,
......@@ -188,9 +189,9 @@ class ChildrenActivity extends StatelessWidget {
),
GestureDetector(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => ReportKidsPage(),
));
// Navigator.of(context).push(MaterialPageRoute(
// builder: (_) => ReportKidsPage( classroom: ),
// ));
},
child: Padding(
padding: const EdgeInsets.all(10.0),
......
This diff is collapsed.
......@@ -6,9 +6,9 @@ import 'package:cross_file/src/types/interface.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/teacherchat.dart';
import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'package:mobile_application_kids/classroomview.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:video_player/video_player.dart';
import 'TeacherProfile.dart';
......@@ -54,7 +54,7 @@ class ChildrenVideo extends StatelessWidget {
),
actions: [
Text(
'Video ',
'Video ',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
......
......@@ -2,8 +2,10 @@ import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/parentHome.dart';
import 'package:jema_app/teacherhome.dart';
import 'package:mobile_application_kids/parentHome.dart';
import 'package:mobile_application_kids/teacherhome.dart';
import 'main.dart';
class ParentLoginPage extends StatefulWidget {
const ParentLoginPage({Key? key, required this.backgroundColor})
......@@ -32,7 +34,15 @@ class _ParentLoginPage extends State<ParentLoginPage> {
color: Color.fromARGB(255, 0, 0, 0),
),
onPressed: () {
Navigator.pop(context);
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => MyHomePage(
title: '',
backgroundColor: Color.fromARGB(255, 181, 181, 181),
),
),
);
},
),
),
......@@ -168,13 +178,12 @@ class _ParentLoginPage extends State<ParentLoginPage> {
animType: AnimType.rightSlide,
title: 'Successfully login',
desc: ' Go to your home page',
btnCancelOnPress: () {},
btnOkOnPress: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
ParentHomePage(documentSnapshot.get('phoneNo')),
ParentHomePage(documentSnapshot.get('phoneNo'), "p"),
),
);
},
......
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/teacherchat.dart';
import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart';
import 'package:jema_app/teacherhome.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'package:mobile_application_kids/classroomview.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/teacherhome.dart';
import 'ChatScreen.dart';
import 'TeacherProfile.dart'; // Import the AddClassroomPage file
import 'TeacherProfile.dart';
import 'kidsReport.dart'; // Import the AddClassroomPage file
class ReportKidsPage extends StatelessWidget {
late User? user;
late final Stream<QuerySnapshot> _usersStream;
ReportKidsPage() {
String classroom;
ReportKidsPage({required this.classroom}) {
user = FirebaseAuth.instance.currentUser;
initializeStreams();
}
void initializeStreams() {
_usersStream = FirebaseFirestore.instance
.collection('classroom')
.where('userId', isEqualTo: user?.uid)
.collection('students')
.where('user', isEqualTo: user?.uid)
.where('className', isEqualTo: classroom)
.snapshots();
}
......@@ -41,7 +44,7 @@ class ReportKidsPage extends StatelessWidget {
),
actions: [
Text(
'Report',
'Report ',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
......@@ -108,7 +111,7 @@ class ReportKidsPage extends StatelessWidget {
itemCount: itemCount,
itemBuilder: (context, index) {
var document = snapshot.data!.docs[index];
var className = document['className'];
var className = document['Firstname'];
return Padding(
padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
......@@ -119,9 +122,8 @@ class ReportKidsPage extends StatelessWidget {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ClassroomViewPage(
documents: className,
),
builder: (context) =>
KidsReportPage(id: document.id),
),
);
},
......
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/login.dart';
import 'package:jema_app/teacherchat.dart';
import 'package:jema_app/teacherhome.dart';
import 'package:mobile_application_kids/login.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'package:mobile_application_kids/teacherhome.dart';
import 'ChatScreen.dart';
......@@ -89,7 +89,7 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> {
),
actions: [
Text(
'Profile',
'Profile ',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
......
......@@ -5,7 +5,7 @@ class ActivitiesPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Activities'),
title: Text('Activities '),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
......@@ -162,7 +162,8 @@ class CameraScreen extends StatelessWidget {
// Implement your camera screen UI here
return Scaffold(
appBar: AppBar(
title: Text(cameraType == CameraType.photo ? 'Take Photo' : 'Record Video'),
title: Text(
cameraType == CameraType.photo ? 'Take Photo' : 'Record Video'),
),
body: Center(
child: Text('Camera Screen Placeholder'),
......
......@@ -2,7 +2,7 @@ import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/teacherhome.dart';
import 'package:mobile_application_kids/teacherhome.dart';
class AddClassroomPage extends StatefulWidget {
@override
......@@ -24,7 +24,7 @@ class _AddClassroomPageState extends State<AddClassroomPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Add Classroom'),
title: Text('Add Classroom '),
),
body: SingleChildScrollView(
child: Center(
......
......@@ -48,7 +48,6 @@ class _AddStudentState extends State<AddStudentPage> {
//imagepicker
ImagePicker _imagePicker = ImagePicker();
XFile? _selectedImage;
String classname;
_AddStudentState(String classname) : this.classname = classname;
......@@ -68,7 +67,7 @@ class _AddStudentState extends State<AddStudentPage> {
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Add Kid',
'Add Kid ',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
......@@ -587,7 +586,7 @@ class _AddStudentState extends State<AddStudentPage> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
TextButton(
onPressed: () async {
if (Image == null) {
AwesomeDialog(
......@@ -630,10 +629,16 @@ class _AddStudentState extends State<AddStudentPage> {
var storageRef = FirebaseStorage.instance
.ref()
.child('student_images/$imageName.jpg');
var uploadTask =
storageRef.putFile(File(_selectedImage!.path));
var downloadUrl =
await (await uploadTask).ref.getDownloadURL();
var uploadTask;
var downloadUrl = "";
if (_selectedImage != null) {
uploadTask = storageRef
.putFile(File(_selectedImage!.path));
downloadUrl =
await (await uploadTask).ref.getDownloadURL();
}
// You can perform signup/authentication logic here
postDetailsToFirestore(
downloadUrl,
......@@ -658,39 +663,37 @@ class _AddStudentState extends State<AddStudentPage> {
context);
}
},
style: ElevatedButton.styleFrom(
primary: Colors.green,
onPrimary: Colors.white,
),
child: Row(
children: [
Column(
children: [
Text('Signup'),
],
),
],
style:
TextButton.styleFrom(backgroundColor: Colors.green),
child: Text(
'Save',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 1,
),
),
),
ElevatedButton(
TextButton(
onPressed: () {
// Handle signup logic here
Navigator.pop(context);
},
style: ElevatedButton.styleFrom(
primary: Colors.white,
onPrimary: Colors.black,
),
child: Row(
children: [
Column(
children: [
Text('Cancel'),
],
),
],
style: TextButton.styleFrom(
backgroundColor: Colors.grey.shade200),
child: Text(
'Cancel',
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 1,
),
),
),
)
],
),
],
......
This diff is collapsed.
......@@ -3,9 +3,9 @@ import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/Attendance.dart';
import 'package:jema_app/ChildrenActivity.dart';
import 'package:jema_app/ReportKids.dart';
import 'package:mobile_application_kids/Attendance.dart';
import 'package:mobile_application_kids/ChildrenActivity.dart';
import 'package:mobile_application_kids/ReportKids.dart';
import 'CheckKids.dart';
import 'ChildrenHomePage.dart';
import 'addstudent.dart';
......@@ -29,6 +29,7 @@ class ClassroomViewPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return Scaffold(
appBar: AppBar(
leading: IconButton(
......@@ -37,7 +38,7 @@ class ClassroomViewPage extends StatelessWidget {
Navigator.pop(context);
},
),
title: Text('Class Room'),
title: Text('Class Room '),
),
body: SingleChildScrollView(
child: Padding(
......@@ -79,7 +80,7 @@ class ClassroomViewPage extends StatelessWidget {
),
SizedBox(height: 10),
Padding(
padding: const EdgeInsets.fromLTRB(20, 40, 20, 20),
padding: EdgeInsets.fromLTRB(width * 0.1, 20, width * 0.1, 20),
child: Container(
width: 293,
height: 44,
......@@ -124,7 +125,8 @@ class ClassroomViewPage extends StatelessWidget {
GestureDetector(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => ChildrenHomePage(),
builder: (_) =>
ChildrenHomePage(classroom: documents),
));
},
child: Padding(
......@@ -567,7 +569,7 @@ class ClassroomViewPage extends StatelessWidget {
GestureDetector(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => ReportKidsPage(),
builder: (_) => ReportKidsPage(classroom: documents),
));
},
child: Padding(
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class KidsReportsPage extends StatelessWidget {
final List<KidData> kidsData = [
KidData(name: 'Adam', imageUrl: "lib/assets/Ellipse 8.png"),
KidData(name: 'Jude', imageUrl: "lib/assets/Ellipse 8.png"),
KidData(name: 'Jude', imageUrl: "lib/assets/Ellipse 8.png"),
KidData(name: 'Anne', imageUrl: 'url_to_kid3_image'),
KidData(name: 'Adam', imageUrl: 'url_to_kid3_image'),
KidData(name: 'Jeny', imageUrl: 'url_to_kid3_image'),
......@@ -15,7 +15,7 @@ class KidsReportsPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Reports'),
title: Text('Reports '),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
......
......@@ -2,10 +2,12 @@ import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/parentHome.dart';
import 'package:jema_app/teacherhome.dart';
import 'package:mobile_application_kids/parentHome.dart';
import 'package:mobile_application_kids/teacherhome.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'main.dart';
class LoginPage extends StatefulWidget {
const LoginPage({Key? key, required this.backgroundColor}) : super(key: key);
final Color backgroundColor;
......@@ -31,7 +33,15 @@ class _LoginPage extends State<LoginPage> {
color: Color.fromARGB(255, 0, 0, 0),
),
onPressed: () {
Navigator.pop(context);
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => MyHomePage(
title: '',
backgroundColor: Color.fromARGB(255, 181, 181, 181),
),
),
);
},
),
),
......@@ -167,7 +177,6 @@ class _LoginPage extends State<LoginPage> {
animType: AnimType.rightSlide,
title: 'Successfully login',
desc: ' Go to your home page',
btnCancelOnPress: () {},
btnOkOnPress: () {
Navigator.pushReplacement(
context,
......@@ -192,7 +201,7 @@ class _LoginPage extends State<LoginPage> {
context,
MaterialPageRoute(
builder: (context) =>
ParentHomePage(documentSnapshot.get('phoneNo')),
ParentHomePage(documentSnapshot.get('phoneNo'), "p"),
),
);
},
......
import 'dart:async';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/sign_in_up.dart';
import 'package:mobile_application_kids/sign_in_up.dart';
import 'firebase_options.dart';
......
import 'package:flutter/material.dart';
import 'package:jema_app/parentSignUp.dart';
import 'package:jema_app/teachersignup.dart';
import 'package:mobile_application_kids/parentSignUp.dart';
import 'package:mobile_application_kids/teachersignup.dart';
import 'ParentLogin.dart';
import 'login.dart';
......
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart';
import 'package:jema_app/teacherchat.dart';
import 'package:mobile_application_kids/classroomview.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'ChatScreen.dart';
import 'TeacherProfile.dart';
......@@ -13,7 +13,9 @@ class ParentHomePage extends StatelessWidget {
late User? user;
late final Stream<QuerySnapshot> _usersStream;
late String phoneNo;
ParentHomePage(param0) {
late String role;
ParentHomePage(param0, role) {
this.role = role;
this.phoneNo = param0;
user = FirebaseAuth.instance.currentUser;
initializeStreams();
......@@ -40,13 +42,13 @@ class ParentHomePage extends StatelessWidget {
},
child: Scaffold(
appBar: AppBar(
leading: Flexible(
child: Image.asset(
'lib/assets/logo.png',
fit: BoxFit.contain,
height: 150, // Adjust the height to make the logo bigger
),
),
// leading: Flexible(
// child: Image.asset(
// 'lib/assets/logo.png',
// fit: BoxFit.contain,
// height: 150, // Adjust the height to make the logo bigger
// ),
// ),
actions: [
IconButton(
icon: Icon(Icons.notifications),
......@@ -125,7 +127,7 @@ class ParentHomePage extends StatelessWidget {
var document = snapshot.data!.docs[index];
var className = document['className'];
var name = document['Firstname'];
print(className);
print(document);
return Padding(
padding: const EdgeInsets.only(
......
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:jema_app/p_or_t.dart';
import 'package:jema_app/parentSignUp.dart';
import 'package:jema_app/teachersignup.dart';
import 'package:mobile_application_kids/p_or_t.dart';
import 'package:mobile_application_kids/parentSignUp.dart';
import 'package:mobile_application_kids/teachersignup.dart';
import 'p_or_t_s.dart';
......
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart';
import 'package:jema_app/teacherchat.dart';
import 'package:mobile_application_kids/classroomview.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/teacherchat.dart';
import 'ChatScreen.dart';
import 'TeacherProfile.dart';
......@@ -37,13 +37,15 @@ class TeacherHomePage extends StatelessWidget {
},
child: Scaffold(
appBar: AppBar(
leading: Flexible(
child: Image.asset(
'lib/assets/logo.png',
fit: BoxFit.contain,
height: 150, // Adjust the height to make the logo bigger
),
),
// leading: Padding(
// padding: const EdgeInsets.only(left: 20),
// child: SizedBox(
// child: Image.asset(
// 'lib/assets/logo.png',
// fit: BoxFit.contain,
// ),
// ),
// ),
actions: [
IconButton(
icon: Icon(Icons.notifications),
......@@ -73,7 +75,6 @@ class TeacherHomePage extends StatelessWidget {
fit: BoxFit.contain,
),
),
SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
......@@ -141,7 +142,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(
bottom: 8.0), // Adjust the spacing as needed
......
......@@ -7,9 +7,13 @@
#include "generated_plugin_registrant.h"
#include <file_selector_linux/file_selector_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
}
......@@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
url_launcher_linux
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
......
......@@ -9,12 +9,22 @@ import cloud_firestore
import file_selector_macos
import firebase_auth
import firebase_core
import firebase_storage
import path_provider_foundation
import rive_common
import shared_preferences_foundation
import sqflite
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
This diff is collapsed.
name: jema_app
name: mobile_application_kids
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
......@@ -35,11 +35,17 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
image_picker: ^0.8.0
firebase_core: ^2.24.2
firebase_auth: ^4.15.3
cloud_firestore: ^4.13.6
awesome_dialog: ^3.1.0
image_picker: ^1.0.6
firebase_storage: ^11.6.0
pie_chart: ^5.4.0
video_player: ^2.7.2
shared_preferences: ^2.2.2
url_launcher: ^6.1.14
cached_network_image: ^3.3.1
dev_dependencies:
......@@ -82,6 +88,13 @@ flutter:
- lib/assets/Vector25.png
- lib/assets/Vector26.png
- lib/assets/Ellipse 8.png
- lib/assets/classlogo.png
- lib/assets/ac1.png
- lib/assets/ac2.png
- lib/assets/ac3.png
- lib/assets/ac4.png
- lib/assets/ac5.png
......
......@@ -8,7 +8,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:jema_app/main.dart';
import 'package:mobile_application_kids/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
......
......@@ -10,7 +10,9 @@
#include <file_selector_windows/file_selector_windows.h>
#include <firebase_auth/firebase_auth_plugin_c_api.h>
#include <firebase_core/firebase_core_plugin_c_api.h>
#include <firebase_storage/firebase_storage_plugin_c_api.h>
#include <rive_common/rive_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
CloudFirestorePluginCApiRegisterWithRegistrar(
......@@ -21,6 +23,10 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FirebaseStoragePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi"));
RivePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("RivePlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
......@@ -7,7 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
firebase_auth
firebase_core
firebase_storage
rive_common
url_launcher_windows
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
......
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