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 { ...@@ -6,8 +6,33 @@ class AddStudentPage extends StatefulWidget {
} }
class _AddStudentPageState extends State<AddStudentPage> { class _AddStudentPageState extends State<AddStudentPage> {
String _selectedSex = 'Male'; String firstName = '';
bool _isSpecialNeedsChild = false; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -15,31 +40,87 @@ class _AddStudentPageState extends State<AddStudentPage> { ...@@ -15,31 +40,87 @@ class _AddStudentPageState extends State<AddStudentPage> {
appBar: AppBar( appBar: AppBar(
title: Text('Add Student'), title: Text('Add Student'),
), ),
body: Padding( body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0), padding: EdgeInsets.all(16.0),
child: SingleChildScrollView( child: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
CircleAvatar( GestureDetector(
radius: 50, onTap: _pickImage,
// Add logic to handle profile image selection child: CircleAvatar(
// backgroundImage: AssetImage('path_to_profile_image'), radius: 50,
backgroundImage: imagePath.isNotEmpty
? AssetImage(imagePath)
: AssetImage('lib/assets/default_profile_image.png'),
),
), ),
SizedBox(height: 16), SizedBox(height: 16),
buildTextFormField('First Name', 'Enter first name'), Align(
buildTextFormField('Last Name', 'Enter last name'), alignment: Alignment.centerLeft,
buildDateOfBirthField(), child: Text(
buildSexDropdown(), 'Bio',
buildMedicineFields(), style: TextStyle(
buildSpecialNeedsFields(), fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(height: 8),
TextField(
onChanged: (value) {
setState(() {
firstName = value;
});
},
decoration: InputDecoration(labelText: 'First Name'),
),
SizedBox(height: 8),
TextField(
onChanged: (value) {
setState(() {
lastName = value;
});
},
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: 8),
TextField(
onChanged: (value) {
setState(() {
sex = value;
});
},
decoration: InputDecoration(labelText: 'Sex'),
),
SizedBox(height: 16), SizedBox(height: 16),
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
// Add logic to save student data // Add student to the classroom logic
// Navigator.pop(context); // Navigate back after saving // You can use 'firstName', 'lastName', 'birthday', 'sex', 'imagePath'
}, },
child: Text('Save Student'), child: Text('Add Student'),
), ),
], ],
), ),
...@@ -47,105 +128,4 @@ class _AddStudentPageState extends State<AddStudentPage> { ...@@ -47,105 +128,4 @@ class _AddStudentPageState extends State<AddStudentPage> {
), ),
); );
} }
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
// }
},
decoration: InputDecoration(
labelText: 'Date of Birth',
hintText: 'Select date of birth',
),
),
);
}
Widget buildSexDropdown() {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: DropdownButtonFormField<String>(
value: _selectedSex,
onChanged: (value) {
setState(() {
_selectedSex = value!;
});
},
items: ['Male', 'Female'].map((sex) {
return DropdownMenuItem<String>(
value: sex,
child: Text(sex),
);
}).toList(),
decoration: InputDecoration(
labelText: 'Sex',
),
),
);
}
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'),
],
);
}
Widget buildSpecialNeedsFields() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text('Special Needs Child: '),
Checkbox(
value: _isSpecialNeedsChild,
onChanged: (value) {
setState(() {
_isSpecialNeedsChild = value!;
});
},
),
],
),
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> { ...@@ -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 { ...@@ -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 { ...@@ -99,9 +99,3 @@ class ChatItem extends StatelessWidget {
); );
} }
} }
void main() {
runApp(MaterialApp(
home: TeacherChatPage(),
));
}
...@@ -299,9 +299,3 @@ class AdditionalInfoPage extends StatelessWidget { ...@@ -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