Commit 58bc9a1b authored by Uditha Prabhasha 's avatar Uditha Prabhasha

update v1.3

parent f77aa56a
No preview for this file type
File added
...@@ -5,7 +5,8 @@ import 'package:jema_app/teacherchat.dart'; ...@@ -5,7 +5,8 @@ import 'package:jema_app/teacherchat.dart';
import 'package:jema_app/classroomview.dart'; import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart'; import 'package:jema_app/addclassroom.dart';
import 'childrenProfile.dart'; // Import the AddClassroomPage file
import 'childrenProfile.dart';
class ChildrenHomePage extends StatelessWidget { class ChildrenHomePage extends StatelessWidget {
late User? user; late User? user;
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'dart:io';
class AddStudent extends StatefulWidget {
const AddStudent({Key? key});
class AddStudentPage extends StatefulWidget {
@override @override
_AddStudentPageState createState() => _AddStudentPageState(); State<AddStudent> createState() => _AddStudentState();
} }
class _AddStudentPageState extends State<AddStudentPage> { class _AddStudentState extends State<AddStudent> {
String firstName = ''; //Bio Part
String lastName = ''; TextEditingController _firstnameController = TextEditingController();
DateTime? birthday; TextEditingController _lastnameController = TextEditingController();
String sex = ''; TextEditingController _birthdayController = TextEditingController();
String imagePath = ''; // Path to the selected profile image TextEditingController _sexController = TextEditingController();
// Function to open the image picker //Medicine Part
void _pickImage() { TextEditingController _doctornameController = TextEditingController();
// Implement your image picking logic (e.g., using ImagePicker) TextEditingController _doctorphoneController = TextEditingController();
// Update 'imagePath' with the selected image path TextEditingController _allergiesController = TextEditingController();
} TextEditingController _medicineController = TextEditingController();
TextEditingController _specailnotController = TextEditingController();
bool _specialNeedsYes = false;
bool _specialNeedsNo = false;
//Contact Part
TextEditingController _parentnameController = TextEditingController();
TextEditingController _parentphoneController = TextEditingController();
TextEditingController _parentemailController = TextEditingController();
//Adress Part
TextEditingController _adressline1Controller = TextEditingController();
TextEditingController _adressline2Controller = TextEditingController();
TextEditingController _cityController = TextEditingController();
TextEditingController _zipController = TextEditingController();
TextEditingController _countryController = TextEditingController();
TextEditingController _stateController = TextEditingController();
//imagepicker
ImagePicker _imagePicker = ImagePicker();
XFile? _selectedImage;
// Function to show date picker for selecting birthday
Future<void> _selectDate(BuildContext context) async {
final DateTime? picked = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1900),
lastDate: DateTime.now(),
);
if (picked != null && picked != birthday) {
setState(() {
birthday = picked;
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Add Student'), leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
actions: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Add Kid',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
),
],
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(16.0), child: SafeArea(
child: Center( child: Padding(
padding: const EdgeInsets.all(16.0),
child: Padding(
padding: const EdgeInsets.all(10),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap: _pickImage, onTap: () async {
XFile? image = await _imagePicker.pickImage(
source: ImageSource.gallery,
imageQuality: 50,
);
setState(() {
_selectedImage = image;
});
},
child: CircleAvatar( child: CircleAvatar(
radius: 50, radius: 50.0,
backgroundImage: imagePath.isNotEmpty backgroundImage: _selectedImage != null
? AssetImage(imagePath) ? Image.file(File(_selectedImage!.path)).image
: AssetImage('lib/assets/default_profile_image.png'), : AssetImage('assets/profile_image.jpg'),
), ),
), ),
SizedBox(height: 16),
Align(
alignment: Alignment.centerLeft,
//Bio Part
SizedBox(height: 20),
Row(
children: [
Container(
child: Text( child: Text(
'Bio', ' Bio',
style: TextStyle( style: const TextStyle(
fontSize: 20, fontSize: 16,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: Color(0xFF22215B),
),
),
),
],
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
style: TextStyle(fontSize: 14.0, fontFamily: 'Poppins'),
controller: _firstnameController,
decoration: InputDecoration(
hintText: 'First Name',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.person,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _lastnameController,
decoration: InputDecoration(
hintText: 'Last Name',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none,
),
suffixIcon: Icon(Icons.person,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0), // Add border here
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _birthdayController,
decoration: InputDecoration(
hintText: 'Birthday',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none,
), ),
suffixIcon: Icon(Icons.cake,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
), ),
), ),
SizedBox(height: 8), ),
TextField(
onChanged: (value) { SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _sexController,
decoration: InputDecoration(
hintText: 'Sex',
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
),
),
),
//Medicine Part
SizedBox(height: 50),
Row(
children: [
Container(
child: Text(
' Medicine',
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: Color(0xFF22215B),
),
),
),
],
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _doctornameController,
decoration: InputDecoration(
hintText: 'Doctor Name',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.person,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _doctorphoneController,
decoration: InputDecoration(
hintText: 'Doctor Phone Number',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.phone,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _allergiesController,
decoration: InputDecoration(
hintText: 'Allergies',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.coronavirus_sharp,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _medicineController,
decoration: InputDecoration(
hintText: 'Medicine',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none,
),
suffixIcon: Icon(Icons.medication_outlined,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: Row(
children: [
Expanded(
child: Text(
' Special Needs Child',
style: TextStyle(
fontSize: 16.0,
color: Color.fromARGB(247, 251, 0, 0),
fontWeight: FontWeight.w500,
),
),
),
SizedBox(width: 20),
Text('Yes'),
Checkbox(
value: _specialNeedsYes,
onChanged: (bool? value) {
setState(() { setState(() {
firstName = value; _specialNeedsYes = value ?? false;
if (_specialNeedsYes) {
_specialNeedsNo =
false; // Unselect "No" if "Yes" is selected
}
}); });
}, },
decoration: InputDecoration(labelText: 'First Name'),
), ),
SizedBox(height: 8), SizedBox(width: 20),
TextField( Text('No'),
onChanged: (value) { Checkbox(
value: _specialNeedsNo,
onChanged: (bool? value) {
setState(() { setState(() {
lastName = value; _specialNeedsNo = value ?? false;
if (_specialNeedsNo) {
_specialNeedsYes =
false; // Unselect "Yes" if "No" is selected
}
}); });
}, },
decoration: InputDecoration(labelText: 'Last Name'),
), ),
SizedBox(height: 8), ],
InkWell( ),
onTap: () => _selectDate(context), ),
child: InputDecorator(
//Contact Part
SizedBox(height: 50),
Row(
children: [
Container(
child: Text(
' Contact',
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: Color(0xFF22215B),
),
),
),
],
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _parentnameController,
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Birthday', hintText: 'Parent Name',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
), ),
child: Row( suffixIcon: Icon(Icons.person,
mainAxisAlignment: MainAxisAlignment.spaceBetween, size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
children: <Widget>[ hintStyle: TextStyle(fontSize: 14.0),
Text( // fontFamily: 'Poppins',
birthday != null ),
? '${birthday!.day}/${birthday!.month}/${birthday!.year}' ),
: 'Select Birthday', ),
),
Icon(Icons.calendar_today), SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _parentphoneController,
decoration: InputDecoration(
hintText: 'Parent Phone Number',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.phone,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _parentemailController,
decoration: InputDecoration(
hintText: 'Parent Email',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.email,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
//Adress Part
SizedBox(height: 50),
Row(
children: [
Container(
child: Text(
' Adress',
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: Color(0xFF22215B),
),
),
),
// Add your other widgets here
], ],
), ),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _adressline1Controller,
decoration: InputDecoration(
hintText: 'Adress Line 1',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
), ),
suffixIcon: Icon(Icons.location_on_outlined,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
), ),
SizedBox(height: 8),
TextField(
onChanged: (value) {
setState(() {
sex = value;
});
},
decoration: InputDecoration(labelText: 'Sex'),
), ),
SizedBox(height: 16), ),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _adressline2Controller,
decoration: InputDecoration(
hintText: 'Adress Line 2',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.location_on_outlined,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _cityController,
decoration: InputDecoration(
hintText: 'City',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.location_city_sharp,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _zipController,
decoration: InputDecoration(
hintText: 'Zip/Postal Code',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.location_searching,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _countryController,
decoration: InputDecoration(
hintText: 'Country',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.location_city_rounded,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 20),
Container(
height: 55.0,
child: TextField(
controller: _stateController,
decoration: InputDecoration(
hintText: 'State/Region',
filled: true,
fillColor: Color.fromARGB(107, 196, 196, 196),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none, // Remove border color
),
suffixIcon: Icon(Icons.location_city_sharp,
size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
hintStyle: TextStyle(fontSize: 14.0),
// fontFamily: 'Poppins',
),
),
),
SizedBox(height: 30),
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
// Add student to the classroom logic // Handle signup logic here
// You can use 'firstName', 'lastName', 'birthday', 'sex', 'imagePath' String firstname = _firstnameController.text;
String lastname = _lastnameController.text;
String birthday = _birthdayController.text;
String sex = _sexController.text;
//Medicine Part
String doctorname = _doctornameController.text;
String doctorphone = _doctorphoneController.text;
String allergies = _allergiesController.text;
String medicine = _medicineController.text;
//Contact Part
String parentname = _parentnameController.text;
String parentphone = _parentphoneController.text;
String parentemail = _parentemailController.text;
//Adress Part
String adressline1 = _adressline1Controller.text;
String adressline2 = _adressline2Controller.text;
String city = _cityController.text;
String zip = _zipController.text;
String country = _countryController.text;
String state = _stateController.text;
print(
'Firstname: $firstname,Lastname: $lastname ,Sex: $sex, Birthday: $birthday, Doctorname: $doctorname, Doctorphone: $doctorphone, Allergies: $allergies, Medicine: $medicine, Parentname: $parentname, Parentphone: $parentphone, Parentemail: $parentemail, Adressline1: $adressline1, Adressline2: $adressline2, City: $city, Zip: $zip, Country: $country, State: $state');
}, },
child: Text('Add Student'), style: ElevatedButton.styleFrom(
primary: Colors.blue,
onPrimary: Colors.white,
),
child: Row(
children: [
Column(
children: [
Text('Add'),
],
), ),
Column(
children: [
Text('Kid'),
], ],
), ),
],
),
),
],
),
),
),
), ),
), ),
); );
......
...@@ -5,6 +5,8 @@ import 'package:jema_app/Attendance.dart'; ...@@ -5,6 +5,8 @@ import 'package:jema_app/Attendance.dart';
import 'ChildrenHomePage.dart'; import 'ChildrenHomePage.dart';
import 'activities.dart'; import 'activities.dart';
import 'addstudent.dart'; import 'addstudent.dart';
import 'kidscheck_in_out.dart';
import 'kidsreports.dart';
class ClassroomViewPage extends StatelessWidget { class ClassroomViewPage extends StatelessWidget {
var documents; var documents;
...@@ -52,7 +54,7 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -52,7 +54,7 @@ class ClassroomViewPage extends StatelessWidget {
// Navigate to AddStudentPage // Navigate to AddStudentPage
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => AddStudentPage()), MaterialPageRoute(builder: (context) => AddStudent()),
); );
}, },
child: Text('Add Student'), child: Text('Add Student'),
...@@ -356,8 +358,15 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -356,8 +358,15 @@ class ClassroomViewPage extends StatelessWidget {
), ),
), ),
), ),
Padding( //check in and out
padding: const EdgeInsets.all(10.0),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => KidsCheckssPage()),
);
},
child: Container( child: Container(
width: 170, width: 170,
height: 85, height: 85,
...@@ -441,6 +450,9 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -441,6 +450,9 @@ class ClassroomViewPage extends StatelessWidget {
), ),
), ),
), ),
//calendar
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: Container( child: Container(
...@@ -506,7 +518,15 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -506,7 +518,15 @@ class ClassroomViewPage extends StatelessWidget {
), ),
), ),
), ),
Padding( //report
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => KidsReportsPage()),
);
},
child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: Container( child: Container(
width: 170, width: 170,
...@@ -527,7 +547,7 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -527,7 +547,7 @@ class ClassroomViewPage extends StatelessWidget {
blurRadius: 2, blurRadius: 2,
offset: Offset(0, 1), offset: Offset(0, 1),
spreadRadius: 0, spreadRadius: 0,
) ),
], ],
), ),
child: Stack( child: Stack(
...@@ -535,7 +555,6 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -535,7 +555,6 @@ class ClassroomViewPage extends StatelessWidget {
Positioned( Positioned(
left: 8, left: 8,
top: 35, top: 35,
child: Container(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
...@@ -556,7 +575,6 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -556,7 +575,6 @@ class ClassroomViewPage extends StatelessWidget {
], ],
), ),
), ),
),
Positioned( Positioned(
right: 8, right: 8,
bottom: 8, bottom: 8,
...@@ -571,6 +589,8 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -571,6 +589,8 @@ class ClassroomViewPage extends StatelessWidget {
), ),
), ),
), ),
),
]), ]),
], ],
), ),
......
import 'package:flutter/material.dart';
class KidsCheckssPage 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: 'Anne', imageUrl: 'url_to_kid3_image'),
// Add more kids data as needed
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Check In / Out'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Bright Sparkle ',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
Text(
'Select Kid',
style: TextStyle(
fontSize: 18,
),
),
SizedBox(height: 16),
ListView.builder(
shrinkWrap: true,
itemCount: (kidsData.length / 4).ceil(),
itemBuilder: (context, rowIndex) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: List.generate(4, (indexInRow) {
final kidIndex = rowIndex * 4 + indexInRow;
if (kidIndex < kidsData.length) {
return KidProfile(
name: kidsData[kidIndex].name,
imageUrl: kidsData[kidIndex].imageUrl,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ReportViewPage(
kidName: kidsData[kidIndex].name,
),
),
);
},
);
} else {
return SizedBox(width: 60, height: 60);
}
}),
);
},
),
],
),
),
);
}
}
class KidData {
final String name;
final String imageUrl;
KidData({required this.name, required this.imageUrl});
}
class KidProfile extends StatelessWidget {
final String name;
final String imageUrl;
final VoidCallback onTap;
const KidProfile({
Key? key,
required this.name,
required this.imageUrl,
required this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Column(
children: [
CircleAvatar(
radius: 30,
backgroundImage: NetworkImage(imageUrl),
),
SizedBox(height: 8),
Text(name),
],
),
);
}
}
class ReportViewPage extends StatelessWidget {
final String kidName;
ReportViewPage({required this.kidName});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Report for $kidName'),
),
body: Center(
child: Text('report content here for $kidName'),
),
);
}
}
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: 'Anne', imageUrl: 'url_to_kid3_image'),
KidData(name: 'Adam', imageUrl: 'url_to_kid3_image'),
KidData(name: 'Jeny', imageUrl: 'url_to_kid3_image'),
KidData(name: 'Joshi', imageUrl: 'url_to_kid3_image'),
// Add more kids data as needed
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Reports'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Bright Sparkle ',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
Text(
'Select Kid',
style: TextStyle(
fontSize: 18,
),
),
SizedBox(height: 16),
ListView.builder(
shrinkWrap: true,
itemCount: (kidsData.length / 4).ceil(),
itemBuilder: (context, rowIndex) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: List.generate(4, (indexInRow) {
final kidIndex = rowIndex * 4 + indexInRow;
if (kidIndex < kidsData.length) {
return KidProfile(
name: kidsData[kidIndex].name,
imageUrl: kidsData[kidIndex].imageUrl,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ReportViewPage(
kidName: kidsData[kidIndex].name,
),
),
);
},
);
} else {
return SizedBox(width: 60, height: 60);
}
}),
);
},
),
],
),
),
);
}
}
class KidData {
final String name;
final String imageUrl;
KidData({required this.name, required this.imageUrl});
}
class KidProfile extends StatelessWidget {
final String name;
final String imageUrl;
final VoidCallback onTap;
const KidProfile({
Key? key,
required this.name,
required this.imageUrl,
required this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Column(
children: [
CircleAvatar(
radius: 30,
backgroundImage: NetworkImage(imageUrl),
),
SizedBox(height: 8),
Text(name),
],
),
);
}
}
class ReportViewPage extends StatelessWidget {
final String kidName;
ReportViewPage({required this.kidName});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Report for $kidName'),
),
body: Center(
child: Text('report content here for $kidName'),
),
);
}
}
...@@ -3,7 +3,7 @@ import 'package:firebase_auth/firebase_auth.dart'; ...@@ -3,7 +3,7 @@ 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:jema_app/teacherchat.dart';
import 'package:jema_app/classroomview.dart'; import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart'; // Import the AddClassroomPage file import 'package:jema_app/addclassroom.dart';
class TeacherHomePage extends StatelessWidget { class TeacherHomePage extends StatelessWidget {
late User? user; late User? user;
......
...@@ -35,11 +35,13 @@ dependencies: ...@@ -35,11 +35,13 @@ 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
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
...@@ -76,6 +78,10 @@ flutter: ...@@ -76,6 +78,10 @@ flutter:
- lib/assets/Vector 2.png - lib/assets/Vector 2.png
- lib/assets/Vector22.png - lib/assets/Vector22.png
- lib/assets/Vector23.png - lib/assets/Vector23.png
- lib/assets/Vector24.png
- lib/assets/Vector25.png
- lib/assets/Vector26.png
- lib/assets/Ellipse 8.png
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment