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

new updates

parent 47ccb2f3
...@@ -9,8 +9,12 @@ ...@@ -9,8 +9,12 @@
import 'package:cloud_firestore_web/cloud_firestore_web.dart'; import 'package:cloud_firestore_web/cloud_firestore_web.dart';
import 'package:firebase_auth_web/firebase_auth_web.dart'; import 'package:firebase_auth_web/firebase_auth_web.dart';
import 'package:firebase_core_web/firebase_core_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:image_picker_for_web/image_picker_for_web.dart';
import 'package:rive_common/rive_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'; import 'package:flutter_web_plugins/flutter_web_plugins.dart';
void registerPlugins([final Registrar? pluginRegistrar]) { void registerPlugins([final Registrar? pluginRegistrar]) {
...@@ -18,7 +22,11 @@ void registerPlugins([final Registrar? pluginRegistrar]) { ...@@ -18,7 +22,11 @@ void registerPlugins([final Registrar? pluginRegistrar]) {
FirebaseFirestoreWeb.registerWith(registrar); FirebaseFirestoreWeb.registerWith(registrar);
FirebaseAuthWeb.registerWith(registrar); FirebaseAuthWeb.registerWith(registrar);
FirebaseCoreWeb.registerWith(registrar); FirebaseCoreWeb.registerWith(registrar);
FirebaseStorageWeb.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar); ImagePickerPlugin.registerWith(registrar);
RivePlugin.registerWith(registrar); RivePlugin.registerWith(registrar);
SharedPreferencesPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
VideoPlayerPlugin.registerWith(registrar);
registrar.registerMessageHandler(); 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/ ...@@ -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_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=/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_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/ 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_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_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_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_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/ 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/ 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 # mobile_application_kids
\ No newline at end of file
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: ...@@ -13,8 +13,7 @@ linter:
# The lint rules applied to this project can be customized in the # The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml` # 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 # included above or to enable additional rules. A list of all available lints
# and their documentation is published at # and their documentation is published at https://dart.dev/lints.
# https://dart-lang.github.io/linter/lints/index.html.
# #
# Instead of disabling a lint rule for the entire project in the # 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 # 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: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';
...@@ -59,7 +59,7 @@ class _AttendanceState extends State<Attendance> { ...@@ -59,7 +59,7 @@ class _AttendanceState extends State<Attendance> {
), ),
actions: [ actions: [
Text( Text(
'Attendance', 'Attendance ',
style: TextStyle( style: TextStyle(
color: Color(0xFF554994), color: Color(0xFF554994),
fontSize: 24, fontSize: 24,
......
...@@ -18,11 +18,19 @@ class _ChatScreenState extends State<ChatScreen> { ...@@ -18,11 +18,19 @@ class _ChatScreenState extends State<ChatScreen> {
late User? _user; late User? _user;
File? _imageFile; File? _imageFile;
String? _voiceFilePath; String? _voiceFilePath;
String? _username;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_user = _auth.currentUser; _user = _auth.currentUser;
fetchFullName(_user!.uid).then((fullName) {
if (fullName != null) {
_username = fullName;
} else {
print('No such document');
}
});
} }
void _sendMessage() async { void _sendMessage() async {
...@@ -43,6 +51,15 @@ class _ChatScreenState extends State<ChatScreen> { ...@@ -43,6 +51,15 @@ class _ChatScreenState extends State<ChatScreen> {
if (_voiceFilePath != null) { if (_voiceFilePath != null) {
voiceUrl = await _uploadFile(File(_voiceFilePath!)); 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({ await _firestore.collection('messages').add({
'text': message, 'text': message,
...@@ -50,6 +67,7 @@ class _ChatScreenState extends State<ChatScreen> { ...@@ -50,6 +67,7 @@ class _ChatScreenState extends State<ChatScreen> {
'user': _user!.uid, 'user': _user!.uid,
'imageUrl': imageUrl, 'imageUrl': imageUrl,
'voiceUrl': voiceUrl, 'voiceUrl': voiceUrl,
'userName': _username
}); });
_imageFile = null; _imageFile = null;
...@@ -75,7 +93,7 @@ class _ChatScreenState extends State<ChatScreen> { ...@@ -75,7 +93,7 @@ class _ChatScreenState extends State<ChatScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Chat'), title: Text('Chat '),
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
...@@ -105,13 +123,15 @@ class _ChatScreenState extends State<ChatScreen> { ...@@ -105,13 +123,15 @@ class _ChatScreenState extends State<ChatScreen> {
as Map<String, dynamic>)['imageUrl'] as String?; as Map<String, dynamic>)['imageUrl'] as String?;
String? voiceUrl = (message.data() String? voiceUrl = (message.data()
as Map<String, dynamic>)['voiceUrl'] as String?; as Map<String, dynamic>)['voiceUrl'] as String?;
String? __username = (message.data()
as Map<String, dynamic>)['userName'] as String?;
return MessageBubble( return MessageBubble(
message: text ?? '', message: text ?? '',
imageUrl: imageUrl, imageUrl: imageUrl,
voiceUrl: voiceUrl, voiceUrl: voiceUrl,
isCurrentUser: isCurrentUser, isCurrentUser: isCurrentUser,
); userName: __username!);
}, },
); );
}, },
...@@ -152,6 +172,22 @@ class _ChatScreenState extends State<ChatScreen> { ...@@ -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 { class MessageBubble extends StatelessWidget {
...@@ -159,6 +195,7 @@ class MessageBubble extends StatelessWidget { ...@@ -159,6 +195,7 @@ class MessageBubble extends StatelessWidget {
final String? imageUrl; final String? imageUrl;
final String? voiceUrl; final String? voiceUrl;
final bool isCurrentUser; final bool isCurrentUser;
final String userName;
const MessageBubble({ const MessageBubble({
Key? key, Key? key,
...@@ -166,6 +203,7 @@ class MessageBubble extends StatelessWidget { ...@@ -166,6 +203,7 @@ class MessageBubble extends StatelessWidget {
required this.isCurrentUser, required this.isCurrentUser,
this.imageUrl, this.imageUrl,
this.voiceUrl, this.voiceUrl,
required this.userName,
}) : super(key: key); }) : super(key: key);
@override @override
...@@ -191,6 +229,13 @@ class MessageBubble extends StatelessWidget { ...@@ -191,6 +229,13 @@ class MessageBubble extends StatelessWidget {
width: 200, width: 200,
), ),
if (message.isNotEmpty) Text(message), 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: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/ChatScreen.dart'; import 'package:mobile_application_kids/ChatScreen.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 'TeacherProfile.dart'; import 'TeacherProfile.dart';
...@@ -41,7 +41,7 @@ class CheckKidsPage extends StatelessWidget { ...@@ -41,7 +41,7 @@ class CheckKidsPage extends StatelessWidget {
), ),
actions: [ actions: [
Text( Text(
'Check In / Out', 'Check In / Out ',
style: TextStyle( style: TextStyle(
color: Color(0xFF554994), color: Color(0xFF554994),
fontSize: 24, fontSize: 24,
...@@ -158,9 +158,9 @@ class CheckKidsPage extends StatelessWidget { ...@@ -158,9 +158,9 @@ class CheckKidsPage extends StatelessWidget {
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: isCheck == 1 color: isCheck == 1
? Color.fromARGB( ? Color.fromARGB(
72, 219, 219, 219) 71, 228, 11, 11)
: Color.fromARGB( : Color.fromARGB(
71, 218, 49, 11), 70, 70, 218, 11),
shape: OvalBorder(), shape: OvalBorder(),
), ),
), ),
......
...@@ -6,11 +6,11 @@ import 'package:cross_file/src/types/interface.dart'; ...@@ -6,11 +6,11 @@ import 'package:cross_file/src/types/interface.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart'; import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jema_app/ChatScreen.dart'; import 'package:mobile_application_kids/ChatScreen.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 'TeacherProfile.dart'; import 'TeacherProfile.dart';
......
...@@ -4,9 +4,9 @@ import 'package:cloud_firestore/cloud_firestore.dart'; ...@@ -4,9 +4,9 @@ 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:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:jema_app/Attendance.dart'; import 'package:mobile_application_kids/Attendance.dart';
import 'package:jema_app/ChildrenVideo.dart'; import 'package:mobile_application_kids/ChildrenVideo.dart';
import 'package:jema_app/ReportKids.dart'; import 'package:mobile_application_kids/ReportKids.dart';
import 'CheckKids.dart'; import 'CheckKids.dart';
import 'ChildrenActiPhone.dart'; import 'ChildrenActiPhone.dart';
import 'ChildrenHomePage.dart'; import 'ChildrenHomePage.dart';
...@@ -31,6 +31,7 @@ class ChildrenActivity extends StatelessWidget { ...@@ -31,6 +31,7 @@ class ChildrenActivity extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
...@@ -60,7 +61,7 @@ class ChildrenActivity extends StatelessWidget { ...@@ -60,7 +61,7 @@ class ChildrenActivity extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.fromLTRB(20, 40, 20, 20), padding: EdgeInsets.fromLTRB(width * 0.1, 20, width * 0.1, 20),
child: Container( child: Container(
width: 293, width: 293,
height: 44, height: 44,
...@@ -188,9 +189,9 @@ class ChildrenActivity extends StatelessWidget { ...@@ -188,9 +189,9 @@ class ChildrenActivity extends StatelessWidget {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute( // Navigator.of(context).push(MaterialPageRoute(
builder: (_) => ReportKidsPage(), // builder: (_) => ReportKidsPage( classroom: ),
)); // ));
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
......
This diff is collapsed.
...@@ -6,9 +6,9 @@ import 'package:cross_file/src/types/interface.dart'; ...@@ -6,9 +6,9 @@ import 'package:cross_file/src/types/interface.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart'; import 'package:firebase_storage/firebase_storage.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:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
import 'TeacherProfile.dart'; import 'TeacherProfile.dart';
......
...@@ -2,8 +2,10 @@ import 'package:awesome_dialog/awesome_dialog.dart'; ...@@ -2,8 +2,10 @@ import 'package:awesome_dialog/awesome_dialog.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/parentHome.dart'; import 'package:mobile_application_kids/parentHome.dart';
import 'package:jema_app/teacherhome.dart'; import 'package:mobile_application_kids/teacherhome.dart';
import 'main.dart';
class ParentLoginPage extends StatefulWidget { class ParentLoginPage extends StatefulWidget {
const ParentLoginPage({Key? key, required this.backgroundColor}) const ParentLoginPage({Key? key, required this.backgroundColor})
...@@ -32,7 +34,15 @@ class _ParentLoginPage extends State<ParentLoginPage> { ...@@ -32,7 +34,15 @@ class _ParentLoginPage extends State<ParentLoginPage> {
color: Color.fromARGB(255, 0, 0, 0), color: Color.fromARGB(255, 0, 0, 0),
), ),
onPressed: () { 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> { ...@@ -168,13 +178,12 @@ class _ParentLoginPage extends State<ParentLoginPage> {
animType: AnimType.rightSlide, animType: AnimType.rightSlide,
title: 'Successfully login', title: 'Successfully login',
desc: ' Go to your home page', desc: ' Go to your home page',
btnCancelOnPress: () {},
btnOkOnPress: () { btnOkOnPress: () {
Navigator.pushReplacement( Navigator.pushReplacement(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
ParentHomePage(documentSnapshot.get('phoneNo')), ParentHomePage(documentSnapshot.get('phoneNo'), "p"),
), ),
); );
}, },
......
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 'ChatScreen.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 { class ReportKidsPage extends StatelessWidget {
late User? user; late User? user;
late final Stream<QuerySnapshot> _usersStream; late final Stream<QuerySnapshot> _usersStream;
ReportKidsPage() { String classroom;
ReportKidsPage({required this.classroom}) {
user = FirebaseAuth.instance.currentUser; user = FirebaseAuth.instance.currentUser;
initializeStreams(); initializeStreams();
} }
void initializeStreams() { void initializeStreams() {
_usersStream = FirebaseFirestore.instance _usersStream = FirebaseFirestore.instance
.collection('classroom') .collection('students')
.where('userId', isEqualTo: user?.uid) .where('user', isEqualTo: user?.uid)
.where('className', isEqualTo: classroom)
.snapshots(); .snapshots();
} }
...@@ -41,7 +44,7 @@ class ReportKidsPage extends StatelessWidget { ...@@ -41,7 +44,7 @@ class ReportKidsPage extends StatelessWidget {
), ),
actions: [ actions: [
Text( Text(
'Report', 'Report ',
style: TextStyle( style: TextStyle(
color: Color(0xFF554994), color: Color(0xFF554994),
fontSize: 24, fontSize: 24,
...@@ -108,7 +111,7 @@ class ReportKidsPage extends StatelessWidget { ...@@ -108,7 +111,7 @@ class ReportKidsPage extends StatelessWidget {
itemCount: itemCount, itemCount: itemCount,
itemBuilder: (context, index) { itemBuilder: (context, index) {
var document = snapshot.data!.docs[index]; var document = snapshot.data!.docs[index];
var className = document['className']; var className = document['Firstname'];
return Padding( return Padding(
padding: const EdgeInsets.fromLTRB(0, 20, 0, 0), padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
...@@ -119,9 +122,8 @@ class ReportKidsPage extends StatelessWidget { ...@@ -119,9 +122,8 @@ class ReportKidsPage extends StatelessWidget {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ClassroomViewPage( builder: (context) =>
documents: className, KidsReportPage(id: document.id),
),
), ),
); );
}, },
......
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/login.dart'; import 'package:mobile_application_kids/login.dart';
import 'package:jema_app/teacherchat.dart'; import 'package:mobile_application_kids/teacherchat.dart';
import 'package:jema_app/teacherhome.dart'; import 'package:mobile_application_kids/teacherhome.dart';
import 'ChatScreen.dart'; import 'ChatScreen.dart';
...@@ -89,7 +89,7 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> { ...@@ -89,7 +89,7 @@ class _TeacherProfilePageState extends State<TeacherProfilePage> {
), ),
actions: [ actions: [
Text( Text(
'Profile', 'Profile ',
style: TextStyle( style: TextStyle(
color: Color(0xFF554994), color: Color(0xFF554994),
fontSize: 24, fontSize: 24,
......
...@@ -5,7 +5,7 @@ class ActivitiesPage extends StatelessWidget { ...@@ -5,7 +5,7 @@ class ActivitiesPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Activities'), title: Text('Activities '),
), ),
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
...@@ -162,7 +162,8 @@ class CameraScreen extends StatelessWidget { ...@@ -162,7 +162,8 @@ class CameraScreen extends StatelessWidget {
// Implement your camera screen UI here // Implement your camera screen UI here
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(cameraType == CameraType.photo ? 'Take Photo' : 'Record Video'), title: Text(
cameraType == CameraType.photo ? 'Take Photo' : 'Record Video'),
), ),
body: Center( body: Center(
child: Text('Camera Screen Placeholder'), child: Text('Camera Screen Placeholder'),
......
...@@ -2,7 +2,7 @@ import 'package:awesome_dialog/awesome_dialog.dart'; ...@@ -2,7 +2,7 @@ import 'package:awesome_dialog/awesome_dialog.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/teacherhome.dart'; import 'package:mobile_application_kids/teacherhome.dart';
class AddClassroomPage extends StatefulWidget { class AddClassroomPage extends StatefulWidget {
@override @override
...@@ -24,7 +24,7 @@ class _AddClassroomPageState extends State<AddClassroomPage> { ...@@ -24,7 +24,7 @@ class _AddClassroomPageState extends State<AddClassroomPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Add Classroom'), title: Text('Add Classroom '),
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
......
...@@ -48,7 +48,6 @@ class _AddStudentState extends State<AddStudentPage> { ...@@ -48,7 +48,6 @@ class _AddStudentState extends State<AddStudentPage> {
//imagepicker //imagepicker
ImagePicker _imagePicker = ImagePicker(); ImagePicker _imagePicker = ImagePicker();
XFile? _selectedImage; XFile? _selectedImage;
String classname; String classname;
_AddStudentState(String classname) : this.classname = classname; _AddStudentState(String classname) : this.classname = classname;
...@@ -68,7 +67,7 @@ class _AddStudentState extends State<AddStudentPage> { ...@@ -68,7 +67,7 @@ class _AddStudentState extends State<AddStudentPage> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
'Add Kid', 'Add Kid ',
style: TextStyle( style: TextStyle(
fontSize: 20.0, fontSize: 20.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
...@@ -587,7 +586,7 @@ class _AddStudentState extends State<AddStudentPage> { ...@@ -587,7 +586,7 @@ class _AddStudentState extends State<AddStudentPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
ElevatedButton( TextButton(
onPressed: () async { onPressed: () async {
if (Image == null) { if (Image == null) {
AwesomeDialog( AwesomeDialog(
...@@ -630,10 +629,16 @@ class _AddStudentState extends State<AddStudentPage> { ...@@ -630,10 +629,16 @@ class _AddStudentState extends State<AddStudentPage> {
var storageRef = FirebaseStorage.instance var storageRef = FirebaseStorage.instance
.ref() .ref()
.child('student_images/$imageName.jpg'); .child('student_images/$imageName.jpg');
var uploadTask = var uploadTask;
storageRef.putFile(File(_selectedImage!.path)); var downloadUrl = "";
var downloadUrl = if (_selectedImage != null) {
uploadTask = storageRef
.putFile(File(_selectedImage!.path));
downloadUrl =
await (await uploadTask).ref.getDownloadURL(); await (await uploadTask).ref.getDownloadURL();
}
// You can perform signup/authentication logic here // You can perform signup/authentication logic here
postDetailsToFirestore( postDetailsToFirestore(
downloadUrl, downloadUrl,
...@@ -658,39 +663,37 @@ class _AddStudentState extends State<AddStudentPage> { ...@@ -658,39 +663,37 @@ class _AddStudentState extends State<AddStudentPage> {
context); context);
} }
}, },
style: ElevatedButton.styleFrom( style:
primary: Colors.green, TextButton.styleFrom(backgroundColor: Colors.green),
onPrimary: Colors.white, child: Text(
'Save',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 1,
), ),
child: Row(
children: [
Column(
children: [
Text('Signup'),
],
), ),
],
), ),
), TextButton(
ElevatedButton(
onPressed: () { onPressed: () {
// Handle signup logic here // Handle signup logic here
Navigator.pop(context); Navigator.pop(context);
}, },
style: ElevatedButton.styleFrom( style: TextButton.styleFrom(
primary: Colors.white, backgroundColor: Colors.grey.shade200),
onPrimary: Colors.black, child: Text(
), 'Cancel',
child: Row( style: TextStyle(
children: [ color: Colors.black,
Column( fontSize: 14,
children: [ fontFamily: 'Poppins',
Text('Cancel'), fontWeight: FontWeight.w600,
], height: 1,
),
],
), ),
), ),
)
], ],
), ),
], ],
......
This diff is collapsed.
...@@ -3,9 +3,9 @@ import 'dart:async'; ...@@ -3,9 +3,9 @@ import 'dart:async';
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/Attendance.dart'; import 'package:mobile_application_kids/Attendance.dart';
import 'package:jema_app/ChildrenActivity.dart'; import 'package:mobile_application_kids/ChildrenActivity.dart';
import 'package:jema_app/ReportKids.dart'; import 'package:mobile_application_kids/ReportKids.dart';
import 'CheckKids.dart'; import 'CheckKids.dart';
import 'ChildrenHomePage.dart'; import 'ChildrenHomePage.dart';
import 'addstudent.dart'; import 'addstudent.dart';
...@@ -29,6 +29,7 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -29,6 +29,7 @@ class ClassroomViewPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
...@@ -37,7 +38,7 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -37,7 +38,7 @@ class ClassroomViewPage extends StatelessWidget {
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
title: Text('Class Room'), title: Text('Class Room '),
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Padding( child: Padding(
...@@ -79,7 +80,7 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -79,7 +80,7 @@ class ClassroomViewPage extends StatelessWidget {
), ),
SizedBox(height: 10), SizedBox(height: 10),
Padding( Padding(
padding: const EdgeInsets.fromLTRB(20, 40, 20, 20), padding: EdgeInsets.fromLTRB(width * 0.1, 20, width * 0.1, 20),
child: Container( child: Container(
width: 293, width: 293,
height: 44, height: 44,
...@@ -124,7 +125,8 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -124,7 +125,8 @@ class ClassroomViewPage extends StatelessWidget {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
builder: (_) => ChildrenHomePage(), builder: (_) =>
ChildrenHomePage(classroom: documents),
)); ));
}, },
child: Padding( child: Padding(
...@@ -567,7 +569,7 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -567,7 +569,7 @@ class ClassroomViewPage extends StatelessWidget {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
builder: (_) => ReportKidsPage(), builder: (_) => ReportKidsPage(classroom: documents),
)); ));
}, },
child: Padding( child: Padding(
......
This diff is collapsed.
This diff is collapsed.
...@@ -15,7 +15,7 @@ class KidsReportsPage extends StatelessWidget { ...@@ -15,7 +15,7 @@ class KidsReportsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Reports'), title: Text('Reports '),
), ),
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
......
...@@ -2,10 +2,12 @@ import 'package:awesome_dialog/awesome_dialog.dart'; ...@@ -2,10 +2,12 @@ import 'package:awesome_dialog/awesome_dialog.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/parentHome.dart'; import 'package:mobile_application_kids/parentHome.dart';
import 'package:jema_app/teacherhome.dart'; import 'package:mobile_application_kids/teacherhome.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'main.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
const LoginPage({Key? key, required this.backgroundColor}) : super(key: key); const LoginPage({Key? key, required this.backgroundColor}) : super(key: key);
final Color backgroundColor; final Color backgroundColor;
...@@ -31,7 +33,15 @@ class _LoginPage extends State<LoginPage> { ...@@ -31,7 +33,15 @@ class _LoginPage extends State<LoginPage> {
color: Color.fromARGB(255, 0, 0, 0), color: Color.fromARGB(255, 0, 0, 0),
), ),
onPressed: () { 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> { ...@@ -167,7 +177,6 @@ class _LoginPage extends State<LoginPage> {
animType: AnimType.rightSlide, animType: AnimType.rightSlide,
title: 'Successfully login', title: 'Successfully login',
desc: ' Go to your home page', desc: ' Go to your home page',
btnCancelOnPress: () {},
btnOkOnPress: () { btnOkOnPress: () {
Navigator.pushReplacement( Navigator.pushReplacement(
context, context,
...@@ -192,7 +201,7 @@ class _LoginPage extends State<LoginPage> { ...@@ -192,7 +201,7 @@ class _LoginPage extends State<LoginPage> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
ParentHomePage(documentSnapshot.get('phoneNo')), ParentHomePage(documentSnapshot.get('phoneNo'), "p"),
), ),
); );
}, },
......
import 'dart:async'; import 'dart:async';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.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 'firebase_options.dart';
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jema_app/parentSignUp.dart'; import 'package:mobile_application_kids/parentSignUp.dart';
import 'package:jema_app/teachersignup.dart'; import 'package:mobile_application_kids/teachersignup.dart';
import 'ParentLogin.dart'; import 'ParentLogin.dart';
import 'login.dart'; import 'login.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/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/teacherchat.dart'; import 'package:mobile_application_kids/teacherchat.dart';
import 'ChatScreen.dart'; import 'ChatScreen.dart';
import 'TeacherProfile.dart'; import 'TeacherProfile.dart';
...@@ -13,7 +13,9 @@ class ParentHomePage extends StatelessWidget { ...@@ -13,7 +13,9 @@ 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;
ParentHomePage(param0) { late String role;
ParentHomePage(param0, role) {
this.role = role;
this.phoneNo = param0; this.phoneNo = param0;
user = FirebaseAuth.instance.currentUser; user = FirebaseAuth.instance.currentUser;
initializeStreams(); initializeStreams();
...@@ -40,13 +42,13 @@ class ParentHomePage extends StatelessWidget { ...@@ -40,13 +42,13 @@ class ParentHomePage extends StatelessWidget {
}, },
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
leading: Flexible( // leading: Flexible(
child: Image.asset( // child: Image.asset(
'lib/assets/logo.png', // 'lib/assets/logo.png',
fit: BoxFit.contain, // fit: BoxFit.contain,
height: 150, // Adjust the height to make the logo bigger // height: 150, // Adjust the height to make the logo bigger
), // ),
), // ),
actions: [ actions: [
IconButton( IconButton(
icon: Icon(Icons.notifications), icon: Icon(Icons.notifications),
...@@ -125,7 +127,7 @@ class ParentHomePage extends StatelessWidget { ...@@ -125,7 +127,7 @@ 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(className); print(document);
return Padding( return Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
......
This diff is collapsed.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jema_app/p_or_t.dart'; import 'package:mobile_application_kids/p_or_t.dart';
import 'package:jema_app/parentSignUp.dart'; import 'package:mobile_application_kids/parentSignUp.dart';
import 'package:jema_app/teachersignup.dart'; import 'package:mobile_application_kids/teachersignup.dart';
import 'p_or_t_s.dart'; import 'p_or_t_s.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/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/teacherchat.dart'; import 'package:mobile_application_kids/teacherchat.dart';
import 'ChatScreen.dart'; import 'ChatScreen.dart';
import 'TeacherProfile.dart'; import 'TeacherProfile.dart';
...@@ -37,13 +37,15 @@ class TeacherHomePage extends StatelessWidget { ...@@ -37,13 +37,15 @@ class TeacherHomePage extends StatelessWidget {
}, },
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
leading: Flexible( // leading: Padding(
child: Image.asset( // padding: const EdgeInsets.only(left: 20),
'lib/assets/logo.png', // child: SizedBox(
fit: BoxFit.contain, // child: Image.asset(
height: 150, // Adjust the height to make the logo bigger // 'lib/assets/logo.png',
), // fit: BoxFit.contain,
), // ),
// ),
// ),
actions: [ actions: [
IconButton( IconButton(
icon: Icon(Icons.notifications), icon: Icon(Icons.notifications),
...@@ -73,7 +75,6 @@ class TeacherHomePage extends StatelessWidget { ...@@ -73,7 +75,6 @@ class TeacherHomePage extends StatelessWidget {
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
SizedBox(height: 20),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
...@@ -141,7 +142,7 @@ class TeacherHomePage extends StatelessWidget { ...@@ -141,7 +142,7 @@ class TeacherHomePage extends StatelessWidget {
itemBuilder: (context, index) { itemBuilder: (context, index) {
var document = snapshot.data!.docs[index]; var document = snapshot.data!.docs[index];
var className = document['className']; var className = document['className'];
print(document);
return Padding( return Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
bottom: 8.0), // Adjust the spacing as needed bottom: 8.0), // Adjust the spacing as needed
......
...@@ -7,9 +7,13 @@ ...@@ -7,9 +7,13 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <file_selector_linux/file_selector_plugin.h> #include <file_selector_linux/file_selector_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar); 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 @@ ...@@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux file_selector_linux
url_launcher_linux
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST
......
...@@ -9,12 +9,22 @@ import cloud_firestore ...@@ -9,12 +9,22 @@ import cloud_firestore
import file_selector_macos import file_selector_macos
import firebase_auth import firebase_auth
import firebase_core import firebase_core
import firebase_storage
import path_provider_foundation
import rive_common import rive_common
import shared_preferences_foundation
import sqflite
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 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")) 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. 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.
...@@ -35,11 +35,17 @@ dependencies: ...@@ -35,11 +35,17 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
image_picker: ^0.8.0
firebase_core: ^2.24.2 firebase_core: ^2.24.2
firebase_auth: ^4.15.3 firebase_auth: ^4.15.3
cloud_firestore: ^4.13.6 cloud_firestore: ^4.13.6
awesome_dialog: ^3.1.0 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: dev_dependencies:
...@@ -82,6 +88,13 @@ flutter: ...@@ -82,6 +88,13 @@ flutter:
- lib/assets/Vector25.png - lib/assets/Vector25.png
- lib/assets/Vector26.png - lib/assets/Vector26.png
- lib/assets/Ellipse 8.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 @@ ...@@ -8,7 +8,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:jema_app/main.dart'; import 'package:mobile_application_kids/main.dart';
void main() { void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async { testWidgets('Counter increments smoke test', (WidgetTester tester) async {
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
#include <file_selector_windows/file_selector_windows.h> #include <file_selector_windows/file_selector_windows.h>
#include <firebase_auth/firebase_auth_plugin_c_api.h> #include <firebase_auth/firebase_auth_plugin_c_api.h>
#include <firebase_core/firebase_core_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 <rive_common/rive_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
CloudFirestorePluginCApiRegisterWithRegistrar( CloudFirestorePluginCApiRegisterWithRegistrar(
...@@ -21,6 +23,10 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { ...@@ -21,6 +23,10 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
FirebaseCorePluginCApiRegisterWithRegistrar( FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FirebaseStoragePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi"));
RivePluginRegisterWithRegistrar( RivePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("RivePlugin")); registry->GetRegistrarForPlugin("RivePlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }
...@@ -7,7 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ...@@ -7,7 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows file_selector_windows
firebase_auth firebase_auth
firebase_core firebase_core
firebase_storage
rive_common rive_common
url_launcher_windows
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST 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