Skip to main content

Events

List Events

GET /parent/co-curricular/get-events?studentId={id}
{
"data": {
"events": [
{
"id": "uuid",
"title": "Annual Day",
"description": "Annual day celebration...",
"eventDate": "2024-04-20",
"venue": "School Auditorium",
"startTime": "10:00",
"endTime": "14:00",
"isOptional": false
}
]
}
}

Upcoming vs Past

Events are split into two tabs:

  • Upcoming — future events sorted by date
  • Past — events that have already occurred

Calendar View

Optional calendar view showing dots on event days:

CalendarView(
eventDays: events.map((e) => e.eventDate).toSet(),
onDaySelected: (date) {
final dayEvents = events.where((e) =>
e.eventDate.year == date.year &&
e.eventDate.month == date.month &&
e.eventDate.day == date.day,
).toList();
// Show bottom sheet with events
},
)

Event Detail

class EventDetailScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(event.title)),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
color: Colors.blue.shade50,
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(event.title, style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
const SizedBox(height: 8),
Row(children: [
const Icon(Icons.calendar_today, size: 16),
const SizedBox(width: 4),
Text('${event.eventDate} • ${event.startTime} - ${event.endTime}'),
]),
Row(children: [
const Icon(Icons.location_on, size: 16),
const SizedBox(width: 4),
Text(event.venue),
]),
],
),
),
Padding(
padding: const EdgeInsets.all(16),
child: Text(event.description),
),
],
),
);
}
}