feat: add two-tab timetable UI and glass dock

This commit is contained in:
Codex
2026-10-12 23:33:33 +08:00
parent 808af007a2
commit 8a98d49d12
17 changed files with 1912 additions and 9 deletions
@@ -0,0 +1,66 @@
import 'package:flutter/material.dart';
import '../../domain/course_occurrence.dart';
import '../../domain/lesson_times.dart';
import '../../app/app_theme.dart';
void showCourseDetails(BuildContext context, CourseOccurrence event) {
showModalBottomSheet<void>(
context: context,
isScrollControlled: true,
showDragHandle: true,
backgroundColor: canvas,
builder: (context) => SafeArea(
child: SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(24, 8, 24, 32),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
event.course.name,
style: const TextStyle(fontSize: 25, fontWeight: FontWeight.w700),
),
const SizedBox(height: 20),
_line(Icons.person_outline_rounded, event.course.teacher),
_line(Icons.location_on_outlined, event.course.room),
_line(
Icons.schedule_rounded,
'${minuteLabel(event.start.hour * 60 + event.start.minute)}–${minuteLabel(event.end.hour * 60 + event.end.minute)} · 第 ${event.course.startPeriod}–${event.course.endPeriod} 节',
),
_line(
Icons.date_range_outlined,
'第 ${event.week} 周 · ${event.start.month} 月 ${event.start.day} 日',
),
_line(
Icons.repeat_rounded,
'上课周次:${(event.course.weeks.toList()..sort()).join('、')}',
),
const SizedBox(height: 18),
SizedBox(
width: double.infinity,
child: FilledButton(
onPressed: () => Navigator.pop(context),
child: const Text('知道了'),
),
),
],
),
),
),
);
}
Widget _line(IconData icon, String text) => Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(icon, size: 21, color: river),
const SizedBox(width: 12),
Expanded(
child: Text(text, style: const TextStyle(fontSize: 15, height: 1.5)),
),
],
),
);