feat: select school before connecting timetable

This commit is contained in:
Codex
2026-10-14 20:58:47 +08:00
parent ce21cdc10c
commit d83481d965
12 changed files with 297 additions and 20 deletions
@@ -18,6 +18,7 @@ class ProfilePage extends StatelessWidget {
super.key,
required this.controller,
required this.onLogin,
this.schoolName,
this.authStatus = '未登录',
this.onLogout,
this.logoutLabel = '退出学校登录',
@@ -26,6 +27,7 @@ class ProfilePage extends StatelessWidget {
});
final AppController controller;
final VoidCallback onLogin;
final String? schoolName;
final VoidCallback? onLogout;
final VoidCallback? onUpdateTerm;
final String authStatus, logoutLabel;
@@ -98,12 +100,12 @@ class ProfilePage extends StatelessWidget {
),
const SizedBox(height: 16),
const Text(
'连接学校课表',
'学校课表',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w700),
),
const SizedBox(height: 7),
Text(
'电子科技大学 · 研究生\n$authStatus',
'${schoolName ?? '选择学校后连接教务系统'}\n$authStatus',
style: TextStyle(
fontSize: 12,
height: 1.8,
@@ -115,7 +117,7 @@ class ProfilePage extends StatelessWidget {
width: double.infinity,
child: FilledButton(
onPressed: onLogin,
child: Text(onLogout == null ? '登录学校账户' : '打开学校课表'),
child: const Text('选择学校'),
),
),
if (onLogout != null)