Skip to content

Commit b70d099

Browse files
committed
feat: not arranged exams
1 parent f344aca commit b70d099

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

Diff for: assets/Boochi-Afraid-Work.jpg

66.5 KB
Loading

Diff for: lib/page/exam/exam.dart

+34-6
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ class _ExamInfoWindowState extends State<ExamInfoWindow> {
3434
title: const Text("考试安排"),
3535
leading: IconButton(
3636
icon: const Icon(Icons.arrow_back),
37-
onPressed: () {
38-
Navigator.pop(context);
39-
},
37+
onPressed: () => Get.back(),
4038
),
4139
actions: [
40+
IconButton(
41+
icon: const Icon(Icons.more_time),
42+
onPressed: () =>
43+
Get.to(() => NoArrangedInfo(list: c.toBeArranged)),
44+
),
4245
IconButton(
4346
icon: const Icon(Icons.info),
4447
onPressed: () {
@@ -103,14 +106,39 @@ class _ExamInfoWindowState extends State<ExamInfoWindow> {
103106
actions: <Widget>[
104107
TextButton(
105108
child: const Text("确定"),
106-
onPressed: () {
107-
Navigator.of(context).pop();
108-
},
109+
onPressed: () => Get.back(),
109110
),
110111
],
111112
);
112113
}
113114

115+
class NoArrangedInfo extends StatelessWidget {
116+
final List<ToBeArranged> list;
117+
const NoArrangedInfo({super.key, required this.list});
118+
119+
@override
120+
Widget build(BuildContext context) {
121+
return Scaffold(
122+
appBar: AppBar(
123+
title: const Text("目前无安排考试的科目"),
124+
),
125+
body: dataList<Card, Card>(
126+
List.generate(
127+
list.length,
128+
(index) => Card(
129+
child: ListTile(
130+
title: Text(list[index].subject),
131+
subtitle: Text("编号: ${list[index].id}\n"
132+
"老师: ${list[index].teacher ?? "没有数据"}"),
133+
),
134+
),
135+
),
136+
(toUse) => toUse,
137+
),
138+
);
139+
}
140+
}
141+
114142
class InfoCard extends StatelessWidget {
115143
final Subject toUse;
116144

0 commit comments

Comments
 (0)