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
void _pickImage() {
// Implement your image picking logic (e.g., using ImagePicker)
// Update 'imagePath' with the selected image path
}
// Function to show date picker for selecting birthday //Medicine Part
Future<void> _selectDate(BuildContext context) async { TextEditingController _doctornameController = TextEditingController();
final DateTime? picked = await showDatePicker( TextEditingController _doctorphoneController = TextEditingController();
context: context, TextEditingController _allergiesController = TextEditingController();
initialDate: DateTime.now(), TextEditingController _medicineController = TextEditingController();
firstDate: DateTime(1900), TextEditingController _specailnotController = TextEditingController();
lastDate: DateTime.now(), 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;
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(
child: Column( padding: const EdgeInsets.all(16.0),
mainAxisAlignment: MainAxisAlignment.center, child: Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.all(10),
children: [ child: Column(
GestureDetector( mainAxisAlignment:
onTap: _pickImage, MainAxisAlignment.center,
child: CircleAvatar( children: [
radius: 50,
backgroundImage: imagePath.isNotEmpty
? AssetImage(imagePath) GestureDetector(
: AssetImage('lib/assets/default_profile_image.png'), onTap: () async {
), XFile? image = await _imagePicker.pickImage(
), source: ImageSource.gallery,
SizedBox(height: 16), imageQuality: 50,
Align( );
alignment: Alignment.centerLeft, setState(() {
child: Text( _selectedImage = image;
'Bio', });
style: TextStyle( },
fontSize: 20, child: CircleAvatar(
fontWeight: FontWeight.bold, radius: 50.0,
backgroundImage: _selectedImage != null
? Image.file(File(_selectedImage!.path)).image
: AssetImage('assets/profile_image.jpg'),
), ),
), ),
),
SizedBox(height: 8),
TextField(
onChanged: (value) { //Bio Part
setState(() { SizedBox(height: 20),
firstName = value; Row(
}); children: [
}, Container(
decoration: InputDecoration(labelText: 'First Name'), child: Text(
), ' Bio',
SizedBox(height: 8), style: const TextStyle(
TextField( fontSize: 16,
onChanged: (value) { fontWeight: FontWeight.bold,
setState(() { fontFamily: 'Poppins',
lastName = value; color: Color(0xFF22215B),
}); ),
}, ),
decoration: InputDecoration(labelText: 'Last Name'), ),
),
SizedBox(height: 8),
InkWell(
onTap: () => _selectDate(context),
child: InputDecorator(
decoration: InputDecoration(
labelText: 'Birthday',
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
birthday != null
? '${birthday!.day}/${birthday!.month}/${birthday!.year}'
: 'Select Birthday',
),
Icon(Icons.calendar_today),
], ],
), ),
), SizedBox(height: 20),
), Container(
SizedBox(height: 8), height: 55.0,
TextField( child: TextField(
onChanged: (value) { style: TextStyle(fontSize: 14.0, fontFamily: 'Poppins'),
setState(() { controller: _firstnameController,
sex = value; decoration: InputDecoration(
}); hintText: 'First Name',
}, filled: true,
decoration: InputDecoration(labelText: 'Sex'), fillColor: Color.fromARGB(107, 196, 196, 196),
), border: OutlineInputBorder(
SizedBox(height: 16), borderRadius: BorderRadius.circular(10.0),
ElevatedButton( borderSide: BorderSide.none, // Remove border color
onPressed: () { ),
// Add student to the classroom logic suffixIcon: Icon(Icons.person,
// You can use 'firstName', 'lastName', 'birthday', 'sex', 'imagePath' size: 23.0, color: Color.fromARGB(132, 12, 12, 12)),
}, hintStyle: TextStyle(fontSize: 14.0),
child: Text('Add Student'), ),
),
),
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: 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(() {
_specialNeedsYes = value ?? false;
if (_specialNeedsYes) {
_specialNeedsNo =
false; // Unselect "No" if "Yes" is selected
}
});
},
),
SizedBox(width: 20),
Text('No'),
Checkbox(
value: _specialNeedsNo,
onChanged: (bool? value) {
setState(() {
_specialNeedsNo = value ?? false;
if (_specialNeedsNo) {
_specialNeedsYes =
false; // Unselect "Yes" if "No" is selected
}
});
},
),
],
),
),
//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(
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
),
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: 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: () {
// 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');
},
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,91 +358,101 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -356,91 +358,101 @@ class ClassroomViewPage extends StatelessWidget {
), ),
), ),
), ),
Padding( //check in and out
padding: const EdgeInsets.all(10.0),
child: Container( GestureDetector(
width: 170, onTap: () {
height: 85, Navigator.push(
clipBehavior: Clip.antiAlias, context,
decoration: ShapeDecoration( MaterialPageRoute(builder: (context) => KidsCheckssPage()),
gradient: LinearGradient( );
begin: Alignment(1.00, -0.01), },
end: Alignment(-1, 0.01), child: Container(
colors: [Color(0xFF03BB9A), Color(0xFF08EBC3)], width: 170,
), height: 85,
shape: RoundedRectangleBorder( clipBehavior: Clip.antiAlias,
borderRadius: BorderRadius.circular(4), decoration: ShapeDecoration(
), gradient: LinearGradient(
shadows: [ begin: Alignment(1.00, -0.01),
BoxShadow( end: Alignment(-1, 0.01),
color: Color(0x3F000000), colors: [Color(0xFF03BB9A), Color(0xFF08EBC3)],
blurRadius: 2,
offset: Offset(0, 1),
spreadRadius: 0,
)
],
), ),
child: Stack( shape: RoundedRectangleBorder(
children: [ borderRadius: BorderRadius.circular(4),
Positioned( ),
left: 8, shadows: [
top: 35, BoxShadow(
child: Container( color: Color(0x3F000000),
child: Column( blurRadius: 2,
mainAxisSize: MainAxisSize.min, offset: Offset(0, 1),
mainAxisAlignment: MainAxisAlignment.start, spreadRadius: 0,
crossAxisAlignment: CrossAxisAlignment.start, )
children: [ ],
Text( ),
' Check In', child: Stack(
style: TextStyle( children: [
color: Colors.white, Positioned(
fontSize: 16, left: 8,
fontFamily: 'Poppins', top: 35,
fontWeight: FontWeight.w700, child: Container(
height: 0.06, child: Column(
letterSpacing: -0.64, mainAxisSize: MainAxisSize.min,
), mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
' Check In',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.06,
letterSpacing: -0.64,
), ),
const SizedBox(height: 8), ),
Padding( const SizedBox(height: 8),
padding: const EdgeInsets.all(8.0), Padding(
child: Text.rich( padding: const EdgeInsets.all(8.0),
TextSpan( child: Text.rich(
children: [ TextSpan(
TextSpan( children: [
text: 'Check Out ', TextSpan(
style: TextStyle( text: 'Check Out ',
color: Colors.white, style: TextStyle(
fontSize: 16, color: Colors.white,
fontFamily: 'Poppins', fontSize: 16,
fontWeight: FontWeight.w500, fontFamily: 'Poppins',
height: 0.07, fontWeight: FontWeight.w500,
letterSpacing: -0.56, height: 0.07,
), letterSpacing: -0.56,
), ),
], ),
), ],
), ),
), ),
], ),
), ],
), ),
), ),
Positioned( ),
right: 8, Positioned(
bottom: 8, right: 8,
child: Image.asset( bottom: 8,
"lib/assets/Vector24.png", child: Image.asset(
width: 59, "lib/assets/Vector24.png",
height: 81, width: 59,
fit: BoxFit.cover, height: 81,
), fit: BoxFit.cover,
), ),
], ),
), ],
), ),
), ),
),
//calendar
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: Container( child: Container(
...@@ -506,36 +518,43 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -506,36 +518,43 @@ class ClassroomViewPage extends StatelessWidget {
), ),
), ),
), ),
Padding( //report
padding: const EdgeInsets.all(10.0), GestureDetector(
child: Container( onTap: () {
width: 170, Navigator.push(
height: 85, context,
clipBehavior: Clip.antiAlias, MaterialPageRoute(builder: (context) => KidsReportsPage()),
decoration: ShapeDecoration( );
gradient: LinearGradient( },
begin: Alignment(1.00, -0.01), child: Padding(
end: Alignment(-1, 0.01), padding: const EdgeInsets.all(10.0),
colors: [Color(0xFF50AE59), Color(0xFF90FC9A)], child: Container(
), width: 170,
shape: RoundedRectangleBorder( height: 85,
borderRadius: BorderRadius.circular(4), clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(1.00, -0.01),
end: Alignment(-1, 0.01),
colors: [Color(0xFF50AE59), Color(0xFF90FC9A)],
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4),
),
shadows: [
BoxShadow(
color: Color(0x3F000000),
blurRadius: 2,
offset: Offset(0, 1),
spreadRadius: 0,
),
],
), ),
shadows: [ child: Stack(
BoxShadow( children: [
color: Color(0x3F000000), Positioned(
blurRadius: 2, left: 8,
offset: Offset(0, 1), top: 35,
spreadRadius: 0,
)
],
),
child: Stack(
children: [
Positioned(
left: 8,
top: 35,
child: Container(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
...@@ -556,21 +575,22 @@ class ClassroomViewPage extends StatelessWidget { ...@@ -556,21 +575,22 @@ class ClassroomViewPage extends StatelessWidget {
], ],
), ),
), ),
), Positioned(
Positioned( right: 8,
right: 8, bottom: 8,
bottom: 8, child: Image.asset(
child: Image.asset( "lib/assets/Vector26.png",
"lib/assets/Vector26.png", width: 59,
width: 59, height: 81,
height: 81, fit: BoxFit.cover,
fit: BoxFit.cover, ),
), ),
), ],
], ),
), ),
), ),
), ),
]), ]),
], ],
), ),
......
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