Commit f77aa56a authored by Uditha Prabhasha 's avatar Uditha Prabhasha

updated the app, activities page

parent 31641ec2
No preview for this file type
This diff is collapsed.
This diff is collapsed.
import 'package:flutter/material.dart';
class ActivitiesPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Activities'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextField(
decoration: InputDecoration(
hintText: 'Search...',
prefixIcon: Icon(Icons.search),
border: OutlineInputBorder(),
),
),
SizedBox(height: 20),
Row(
children: [
Expanded(
child: CameraActivityBox(
title: 'Photo',
icon: Icons.photo,
cameraType: CameraType.photo,
),
),
SizedBox(width: 16),
Expanded(
child: CameraActivityBox(
title: 'Video',
icon: Icons.video_library,
cameraType: CameraType.video,
),
),
],
),
SizedBox(height: 20),
Row(
children: [
Expanded(
child: ActivityBox(
title: 'Social Activities',
icon: Icons.group,
),
),
SizedBox(width: 16),
Expanded(
child: ActivityBox(
title: 'Whiteboard',
icon: Icons.border_color,
),
),
],
),
SizedBox(height: 20),
Row(
children: [
Expanded(
child: ActivityBox(
title: 'Kid Activity',
icon: Icons.child_care,
),
),
],
),
],
),
),
);
}
}
class ActivityBox extends StatelessWidget {
final String title;
final IconData icon;
final Function()? onTap;
const ActivityBox({
Key? key,
required this.title,
required this.icon,
this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
height: 100,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
size: 40,
color: Colors.blue,
),
SizedBox(height: 5),
Text(
title,
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
],
),
),
);
}
}
enum CameraType { photo, video }
class CameraActivityBox extends StatelessWidget {
final String title;
final IconData icon;
final CameraType cameraType;
const CameraActivityBox({
Key? key,
required this.title,
required this.icon,
required this.cameraType,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return ActivityBox(
title: title,
icon: icon,
onTap: () {
// Navigate to the camera screen based on the camera type
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CameraScreen(cameraType: cameraType),
),
);
},
);
}
}
class CameraScreen extends StatelessWidget {
final CameraType cameraType;
const CameraScreen({Key? key, required this.cameraType}) : super(key: key);
@override
Widget build(BuildContext context) {
// Implement your camera screen UI here
return Scaffold(
appBar: AppBar(
title: Text(cameraType == CameraType.photo ? 'Take Photo' : 'Record Video'),
),
body: Center(
child: Text('Camera Screen Placeholder'),
),
);
}
}
......@@ -6,8 +6,33 @@ class AddStudentPage extends StatefulWidget {
}
class _AddStudentPageState extends State<AddStudentPage> {
String _selectedSex = 'Male';
bool _isSpecialNeedsChild = false;
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
}
// 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) {
......@@ -15,137 +40,92 @@ class _AddStudentPageState extends State<AddStudentPage> {
appBar: AppBar(
title: Text('Add Student'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
body: SingleChildScrollView(
padding: EdgeInsets.all(16.0),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
CircleAvatar(
children: [
GestureDetector(
onTap: _pickImage,
child: CircleAvatar(
radius: 50,
// Add logic to handle profile image selection
// backgroundImage: AssetImage('path_to_profile_image'),
),
SizedBox(height: 16),
buildTextFormField('First Name', 'Enter first name'),
buildTextFormField('Last Name', 'Enter last name'),
buildDateOfBirthField(),
buildSexDropdown(),
buildMedicineFields(),
buildSpecialNeedsFields(),
SizedBox(height: 16),
ElevatedButton(
onPressed: () {
// Add logic to save student data
// Navigator.pop(context); // Navigate back after saving
},
child: Text('Save Student'),
),
],
backgroundImage: imagePath.isNotEmpty
? AssetImage(imagePath)
: AssetImage('lib/assets/default_profile_image.png'),
),
),
SizedBox(height: 16),
Align(
alignment: Alignment.centerLeft,
child: Text(
'Bio',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
);
}
Widget buildTextFormField(String label, String hint) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: TextFormField(
decoration: InputDecoration(
labelText: label,
hintText: hint,
),
),
);
}
Widget buildDateOfBirthField() {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: TextFormField(
readOnly: true,
onTap: () async {
// Add logic to show date picker
// final DateTime picked = await showDatePicker(
// context: context,
// initialDate: DateTime.now(),
// firstDate: DateTime(2000),
// lastDate: DateTime(2101),
// );
// if (picked != null && picked != DateTime.now()) {
// // Handle the selected date
// }
SizedBox(height: 8),
TextField(
onChanged: (value) {
setState(() {
firstName = value;
});
},
decoration: InputDecoration(
labelText: 'Date of Birth',
hintText: 'Select date of birth',
decoration: InputDecoration(labelText: 'First Name'),
),
),
);
}
Widget buildSexDropdown() {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: DropdownButtonFormField<String>(
value: _selectedSex,
SizedBox(height: 8),
TextField(
onChanged: (value) {
setState(() {
_selectedSex = value!;
lastName = value;
});
},
items: ['Male', 'Female'].map((sex) {
return DropdownMenuItem<String>(
value: sex,
child: Text(sex),
);
}).toList(),
decoration: InputDecoration(labelText: 'Last Name'),
),
SizedBox(height: 8),
InkWell(
onTap: () => _selectDate(context),
child: InputDecorator(
decoration: InputDecoration(
labelText: 'Sex',
labelText: 'Birthday',
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
birthday != null
? '${birthday!.day}/${birthday!.month}/${birthday!.year}'
: 'Select Birthday',
),
);
}
Widget buildMedicineFields() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildTextFormField('Doctor Name', 'Enter doctor name'),
buildTextFormField('Doctor Phone', 'Enter doctor phone'),
buildTextFormField('Allergies', 'Enter allergies'),
buildTextFormField('Medicine', 'Enter medicine'),
Icon(Icons.calendar_today),
],
);
}
Widget buildSpecialNeedsFields() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text('Special Needs Child: '),
Checkbox(
value: _isSpecialNeedsChild,
),
),
),
SizedBox(height: 8),
TextField(
onChanged: (value) {
setState(() {
_isSpecialNeedsChild = value!;
sex = value;
});
},
decoration: InputDecoration(labelText: 'Sex'),
),
],
SizedBox(height: 16),
ElevatedButton(
onPressed: () {
// Add student to the classroom logic
// You can use 'firstName', 'lastName', 'birthday', 'sex', 'imagePath'
},
child: Text('Add Student'),
),
if (_isSpecialNeedsChild)
buildTextFormField('Special Note', 'Enter special note'),
],
),
),
),
);
}
}
void main() {
runApp(MaterialApp(
home: AddStudentPage(),
));
}
This diff is collapsed.
This diff is collapsed.
......@@ -241,11 +241,3 @@ class _LoginPage extends State<LoginPage> {
}
}
}
void main() {
runApp(const MaterialApp(
home: LoginPage(
backgroundColor: Color.fromARGB(255, 225, 226, 226),
),
));
}
......@@ -104,11 +104,3 @@ class SignInUpPage extends StatelessWidget {
);
}
}
void main() {
runApp(const MaterialApp(
home: SignInUpPage(
backgroundColor: Color.fromARGB(255, 225, 226, 226),
),
));
}
import 'package:flutter/material.dart';
class TeacherActivitiesPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Activities'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 20),
Text(
'Activities',
style: TextStyle(
color: Color(0xFF554994),
fontSize: 24,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 0.04,
letterSpacing: -0.96,
),
),
SizedBox(height: 20),
// Your activities widgets here
// ...
],
),
),
);
}
}
......@@ -99,9 +99,3 @@ class ChatItem extends StatelessWidget {
);
}
}
void main() {
runApp(MaterialApp(
home: TeacherChatPage(),
));
}
......@@ -299,9 +299,3 @@ class AdditionalInfoPage extends StatelessWidget {
);
}
}
void main() {
runApp(MaterialApp(
home: TeacherSignupPage(),
));
}
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