New Update V1.5

parent 977c086c
No preview for this file type
// 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
......@@ -190,28 +190,28 @@ class ChildrenActivity extends StatelessWidget {
),
),
),
GestureDetector(
onTap: () {
// GestureDetector(
// onTap: () {
// Navigator.of(context).push(MaterialPageRoute(
// builder: (_) => ReportKidsPage( classroom: ),
// ));
},
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
width: 170,
height: 85,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
'lib/assets/ac6.png'),
fit: BoxFit
.cover,
)),
),
),
),
// },
// child: Padding(
// padding: const EdgeInsets.all(10.0),
// child: Container(
// width: 170,
// height: 85,
// clipBehavior: Clip.antiAlias,
// decoration: BoxDecoration(
// image: DecorationImage(
// image: AssetImage(
// 'lib/assets/ac6.png'),
// fit: BoxFit
// .cover,
// )),
// ),
// ),
// ),
]),
],
),
......
......@@ -900,45 +900,45 @@ class pChildrenProfilePage extends StatelessWidget {
],
),
),
bottomNavigationBar: BottomNavigationBar(
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.chat),
label: 'Chat',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profile',
),
],
selectedItemColor: Colors.blue,
onTap: (index) {
// Handle bottom navigation item tap
if (index == 0) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => TeacherHomePage()),
);
}
if (index == 1) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ChatScreen()),
);
}
if (index == 2) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TeacherProfilePage(uid: user?.uid)),
);
}
},
),
// bottomNavigationBar: BottomNavigationBar(
// items: const [
// BottomNavigationBarItem(
// icon: Icon(Icons.home),
// label: 'Home',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.chat),
// label: 'Chat',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.person),
// label: 'Profile',
// ),
// ],
// selectedItemColor: Colors.blue,
// onTap: (index) {
// // Handle bottom navigation item tap
// if (index == 0) {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => TeacherHomePage()),
// );
// }
// if (index == 1) {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => ChatScreen()),
// );
// }
// if (index == 2) {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => TeacherProfilePage(uid: user?.uid)),
// );
// }
// },
// ),
),
);
}
......
......@@ -60,17 +60,17 @@ class ActivitiesPage extends StatelessWidget {
),
],
),
SizedBox(height: 20),
Row(
children: [
Expanded(
child: ActivityBox(
title: 'Environment',
icon: Icons.child_care,
),
),
],
),
// SizedBox(height: 20),
// Row(
// children: [
// Expanded(
// child: ActivityBox(
// title: 'Environment',
// icon: Icons.child_care,
// ),
// ),
// ],
// ),
],
),
),
......
......@@ -5,8 +5,6 @@ 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});
......@@ -19,7 +17,6 @@ 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();
......@@ -53,9 +50,6 @@ class _AddStudentState extends State<AddStudentPage> {
XFile? _selectedImage;
String classname;
String? _selectedSex;
DateTime? _selectedBirthday;
_AddStudentState(String classname) : this.classname = classname;
@override
......@@ -169,38 +163,13 @@ class _AddStudentState extends State<AddStudentPage> {
),
),
// SizedBox(height: 20),
// GestureDetector(
// onTap: () => _selectDate(context),
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
// decoration: BoxDecoration(
// color: Color.fromARGB(107, 196, 196, 196),
// borderRadius: BorderRadius.circular(10.0),
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // Aligns children to both ends
// children: [
// Expanded( // Text takes up all available space, pushing the icon to the right
// child: Text(
// _selectedBirthday != null ? DateFormat('yyyy-MM-dd').format(_selectedBirthday!) : 'Select Birthday',
// style: TextStyle(fontSize: 14.0, color: Colors.black54),
// ),
// ),
// Icon(Icons.cake, size: 23.0, color: Color.fromARGB(132, 12, 12, 12)), // Icon on the right
// ],
// ),
// ),
// ),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _birthdayController,
decoration: InputDecoration(
hintText: 'Birthday',
hintText: 'Birthday YYYY-MM-DD',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
......@@ -217,34 +186,25 @@ class _AddStudentState extends State<AddStudentPage> {
SizedBox(height: 20),
Container(
height: 55.0,
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
),
child: DropdownButtonFormField<String>(
value: _selectedSex, // This should be a variable in your state class initialized to null or the default value
child: TextField(
controller: _sexController,
decoration: InputDecoration(
border: InputBorder.none,
// contentPadding: EdgeInsets.zero,
suffixIcon: Icon(Icons.people, size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintText: 'Male/Female',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none,
),
suffixIcon: Icon(Icons.people,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0), // Add border here
),
hint: Text('Gender', style: TextStyle(fontSize: 14.0)), // Placeholder text
onChanged: (String? newValue) {
setState(() {
_selectedSex = newValue; // Update the state with the new value
});
},
items: <String>['Male', 'Female'].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
),
//Medicine Part
SizedBox(height: 50),
Row(
children: [
......@@ -626,7 +586,7 @@ class _AddStudentState extends State<AddStudentPage> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
TextButton(
onPressed: () async {
if (Image == null) {
AwesomeDialog(
......@@ -704,38 +664,36 @@ class _AddStudentState extends State<AddStudentPage> {
}
},
style:
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),
TextButton.styleFrom(backgroundColor: Colors.green),
child: Text(
'Save',
style: TextStyle(color: const Color.fromARGB(255, 255, 255, 255)),
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: const Color.fromARGB(255, 255, 255, 255),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(10.0),
style: TextButton.styleFrom(
backgroundColor: Colors.grey.shade200),
child: Text(
'Cancel',
style: TextStyle(color: Colors.black),
),
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 1,
),
),
)
],
),
],
......@@ -808,18 +766,3 @@ class _AddStudentState extends State<AddStudentPage> {
)..show();
}
}
\ No newline at end of file
Future<void> _selectDate(BuildContext context) async {
final DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: DateTime.now(), // Initial date set to current date
firstDate: DateTime(1900), // Earliest allowable date
lastDate: DateTime.now(), // Latest allowable date is today
);
// if (pickedDate != null && pickedDate != DateTime.now()) {
// setState(() {
// // Format the date and update the text field
// _birthdayController.text = DateFormat('yyyy-MM-dd').format(pickedDate);
// });
// }
}
......@@ -12,7 +12,25 @@ class GamesPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Games'),
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.of(context).pop();
},
),
actions: [
Text(
'Games ',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
)
],
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -145,59 +163,59 @@ class GamesPage extends StatelessWidget {
],
),
bottomNavigationBar: BottomNavigationBar(
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.chat),
label: 'Chat',
),
BottomNavigationBarItem(
icon: Icon(Icons.sports_baseball),
label: 'Games',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profile',
),
],
selectedItemColor: Colors.blueAccent,
unselectedItemColor: Colors.grey,
currentIndex: 2,
onTap: (index) {
switch (index) {
case 0:
// Navigate to Home
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => ParentHomePage(phoneNo, role)),
// );
break;
case 1:
// Navigate to Chat
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ChatScreen()),
);
break;
case 2:
// Do nothing, we are already on the Games page
break;
case 3:
// Navigate to Profile
// bottomNavigationBar: BottomNavigationBar(
// items: const [
// BottomNavigationBarItem(
// icon: Icon(Icons.home),
// label: 'Home',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.chat),
// label: 'Chat',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.sports_baseball),
// label: 'Games',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.person),
// label: 'Profile',
// ),
// ],
// selectedItemColor: Colors.blueAccent,
// unselectedItemColor: Colors.grey,
// currentIndex: 2,
// onTap: (index) {
// switch (index) {
// case 0:
// // Navigate to Home
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => ParentHomePage(phoneNo, role)),
// // );
// break;
// case 1:
// // Navigate to Chat
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => ParentProfilePage(uid: uid, phoneNo: phoneNo, role: role),
// ),
// MaterialPageRoute(builder: (context) => ChatScreen()),
// );
break;
}
},
),
// break;
// case 2:
// // Do nothing, we are already on the Games page
// break;
// case 3:
// // Navigate to Profile
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => ParentProfilePage(uid: uid, phoneNo: phoneNo, role: role),
// // ),
// // );
// break;
// }
// },
//),
);
}
}
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