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';
import 'package:jema_app/classroomview.dart';
import 'package:jema_app/addclassroom.dart';
import 'childrenProfile.dart'; // Import the AddClassroomPage file
import 'childrenProfile.dart';
class ChildrenHomePage extends StatelessWidget {
late User? user;
......
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
_AddStudentPageState createState() => _AddStudentPageState();
State<AddStudent> createState() => _AddStudentState();
}
class _AddStudentPageState extends State<AddStudentPage> {
String firstName = '';
String lastName = '';
DateTime? birthday;
String sex = '';
String imagePath = ''; // Path to the selected profile image
// Function to open the image picker
void _pickImage() {
// Implement your image picking logic (e.g., using ImagePicker)
// Update 'imagePath' with the selected image path
}
class _AddStudentState extends State<AddStudent> {
//Bio Part
TextEditingController _firstnameController = TextEditingController();
TextEditingController _lastnameController = TextEditingController();
TextEditingController _birthdayController = TextEditingController();
TextEditingController _sexController = TextEditingController();
//Medicine Part
TextEditingController _doctornameController = TextEditingController();
TextEditingController _doctorphoneController = TextEditingController();
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
Widget build(BuildContext context) {
return Scaffold(
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(
padding: EdgeInsets.all(16.0),
child: Center(
child: SafeArea(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Padding(
padding: const EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
GestureDetector(
onTap: _pickImage,
onTap: () async {
XFile? image = await _imagePicker.pickImage(
source: ImageSource.gallery,
imageQuality: 50,
);
setState(() {
_selectedImage = image;
});
},
child: CircleAvatar(
radius: 50,
backgroundImage: imagePath.isNotEmpty
? AssetImage(imagePath)
: AssetImage('lib/assets/default_profile_image.png'),
radius: 50.0,
backgroundImage: _selectedImage != null
? Image.file(File(_selectedImage!.path)).image
: AssetImage('assets/profile_image.jpg'),
),
),
SizedBox(height: 16),
Align(
alignment: Alignment.centerLeft,
//Bio Part
SizedBox(height: 20),
Row(
children: [
Container(
child: Text(
'Bio',
style: TextStyle(
fontSize: 20,
' Bio',
style: const TextStyle(
fontSize: 16,
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(() {
firstName = value;
_specialNeedsYes = value ?? false;
if (_specialNeedsYes) {
_specialNeedsNo =
false; // Unselect "No" if "Yes" is selected
}
});
},
decoration: InputDecoration(labelText: 'First Name'),
),
SizedBox(height: 8),
TextField(
onChanged: (value) {
SizedBox(width: 20),
Text('No'),
Checkbox(
value: _specialNeedsNo,
onChanged: (bool? value) {
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(
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
birthday != null
? '${birthday!.day}/${birthday!.month}/${birthday!.year}'
: 'Select Birthday',
),
Icon(Icons.calendar_today),
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: _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(
onPressed: () {
// Add student to the classroom logic
// You can use 'firstName', 'lastName', 'birthday', 'sex', 'imagePath'
// Handle signup logic here
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';
import 'ChildrenHomePage.dart';
import 'activities.dart';
import 'addstudent.dart';
import 'kidscheck_in_out.dart';
import 'kidsreports.dart';
class ClassroomViewPage extends StatelessWidget {
var documents;
......@@ -52,7 +54,7 @@ class ClassroomViewPage extends StatelessWidget {
// Navigate to AddStudentPage
Navigator.push(
context,
MaterialPageRoute(builder: (context) => AddStudentPage()),
MaterialPageRoute(builder: (context) => AddStudent()),
);
},
child: Text('Add Student'),
......@@ -356,8 +358,15 @@ class ClassroomViewPage extends StatelessWidget {
),
),
),
Padding(
padding: const EdgeInsets.all(10.0),
//check in and out
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => KidsCheckssPage()),
);
},
child: Container(
width: 170,
height: 85,
......@@ -441,6 +450,9 @@ class ClassroomViewPage extends StatelessWidget {
),
),
),
//calendar
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
......@@ -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),
child: Container(
width: 170,
......@@ -527,7 +547,7 @@ class ClassroomViewPage extends StatelessWidget {
blurRadius: 2,
offset: Offset(0, 1),
spreadRadius: 0,
)
),
],
),
child: Stack(
......@@ -535,7 +555,6 @@ class ClassroomViewPage extends StatelessWidget {
Positioned(
left: 8,
top: 35,
child: Container(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
......@@ -556,7 +575,6 @@ class ClassroomViewPage extends StatelessWidget {
],
),
),
),
Positioned(
right: 8,
bottom: 8,
......@@ -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';
import 'package:flutter/material.dart';
import 'package:jema_app/teacherchat.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 {
late User? user;
......
......@@ -35,11 +35,13 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
image_picker: ^0.8.0
firebase_core: ^2.24.2
firebase_auth: ^4.15.3
cloud_firestore: ^4.13.6
awesome_dialog: ^3.1.0
dev_dependencies:
flutter_test:
sdk: flutter
......@@ -76,6 +78,10 @@ flutter:
- lib/assets/Vector 2.png
- lib/assets/Vector22.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