feat: integrate undergraduate school workflows and period twelve

This commit is contained in:
Codex
2026-10-15 00:28:04 +08:00
parent 7939bd4c3c
commit b28f333720
15 changed files with 573 additions and 26 deletions
@@ -24,6 +24,10 @@ void showCourseDetails(BuildContext context, CourseOccurrence event) {
const SizedBox(height: 20),
_line(Icons.person_outline_rounded, event.course.teacher),
_line(Icons.location_on_outlined, event.course.room),
if (event.course.courseCode.isNotEmpty)
_line(Icons.tag_rounded, '课程代码:${event.course.courseCode}'),
if (event.course.notes.isNotEmpty)
_line(Icons.info_outline_rounded, event.course.notes),
_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} 节',
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import '../../app/app_controller.dart';
import '../../app/app_theme.dart';
import '../../domain/schedule_engine.dart';
import '../../domain/school_identity.dart';
import '../../widgets/directional_week_transition.dart';
import '../profile/settings_page.dart';
import 'week_grid.dart';
@@ -84,13 +85,24 @@ class _TimetablePageState extends State<TimetablePage> {
Padding(
padding: const EdgeInsets.fromLTRB(14, 0, 14, 8),
child: Text(
c.snapshot.schoolTerm!.label,
'${c.snapshot.schoolTerm!.school.label} · ${c.snapshot.schoolTerm!.label}',
style: TextStyle(
fontSize: 12,
color: ink.withValues(alpha: 0.5),
),
),
),
if (!c.isDemo &&
c.snapshot.schoolTerm != null &&
c.snapshot.selectedSchool != null &&
c.snapshot.selectedSchool != c.snapshot.schoolTerm!.school)
Padding(
padding: const EdgeInsets.fromLTRB(14, 0, 14, 8),
child: Text(
'当前仍为${c.snapshot.schoolTerm!.school.label}课表;新课表导入成功后才会替换。',
style: const TextStyle(fontSize: 12, color: river),
),
),
const SizedBox(height: 10),
SurfaceCard(
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 0),
@@ -182,6 +194,12 @@ class _TimetablePageState extends State<TimetablePage> {
monday: monday,
today: today,
settings: c.visibleSettings,
periodCount:
!c.isDemo &&
c.snapshot.schoolTerm?.school ==
SupportedSchool.uestcUndergraduate
? 12
: 11,
),
),
const SizedBox(height: 12),
+6 -4
View File
@@ -14,7 +14,9 @@ class WeekGrid extends StatelessWidget {
required this.monday,
required this.today,
required this.settings,
});
this.periodCount = 11,
}) : assert(periodCount == 11 || periodCount == 12);
final int periodCount;
final List<CourseOccurrence> events;
final DateTime monday, today;
final AppSettings settings;
@@ -111,7 +113,7 @@ class WeekGrid extends StatelessWidget {
(period - 1) * rowHeight +
(period > 4 ? gap : 0) +
(period > 8 ? gap : 0);
final height = 11 * rowHeight + 2 * gap;
final height = periodCount * rowHeight + 2 * gap;
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -120,7 +122,7 @@ class WeekGrid extends StatelessWidget {
height: header + height,
child: Stack(
children: [
for (final slot in lessonSlots)
for (final slot in lessonSlots.take(periodCount))
Positioned(
top: header + top(slot.period),
left: 0,
@@ -244,7 +246,7 @@ class WeekGrid extends StatelessWidget {
),
),
),
for (var p = 1; p <= 11; p++)
for (var p = 1; p <= periodCount; p++)
Positioned(
left: 0,
right: 0,