feat: deliver Riverside Schedule seven-day grid and school HTML import

This commit is contained in:
Codex
2026-10-13 11:18:50 +08:00
parent 91a2522043
commit 8403be05da
29 changed files with 1246 additions and 446 deletions
+10 -25
View File
@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import '../../app/app_controller.dart';
import '../../app/app_theme.dart';
import '../../data/json_schedule_import.dart';
import '../../data/schedule_file_import.dart';
import 'settings_page.dart';
import 'import_preview.dart';
@@ -26,7 +26,7 @@ class ProfilePage extends StatelessWidget {
try {
final file = await FilePicker.pickFile(
type: FileType.custom,
allowedExtensions: ['json'],
allowedExtensions: ['json', 'html', 'htm'],
);
if (file == null) return;
final bytes = BytesBuilder(copy: false);
@@ -38,7 +38,7 @@ class ProfilePage extends StatelessWidget {
}
bytes.add(chunk);
}
final draft = JsonScheduleImport.parse(utf8.decode(bytes.takeBytes()));
final draft = ScheduleFileImport.parse(utf8.decode(bytes.takeBytes()));
if (!context.mounted) return;
await showModalBottomSheet<bool>(
context: context,
@@ -61,31 +61,16 @@ class ProfilePage extends StatelessWidget {
return ListView(
padding: EdgeInsets.fromLTRB(
22,
26,
10,
22,
145 + MediaQuery.paddingOf(context).bottom,
),
children: [
Text(
'YOUR LITTLE RIVERSIDE',
style: TextStyle(
fontSize: 10,
letterSpacing: 1.8,
color: river.withValues(alpha: 0.75),
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 10),
const Text(
'我的河畔',
style: TextStyle(fontSize: 29, fontWeight: FontWeight.w700),
'Riverside Schedule',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700),
),
const SizedBox(height: 7),
Text(
'把时间,留给真正重要的事。',
style: TextStyle(fontSize: 13, color: ink.withValues(alpha: 0.5)),
),
const SizedBox(height: 26),
const SizedBox(height: 16),
SurfaceCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -207,14 +192,14 @@ class ProfilePage extends StatelessWidget {
_tile(
Icons.file_download_outlined,
'从文件导入',
'先预览,再替换课表',
'学校 HTML / JSON · 先预览再导入',
() => _import(context),
),
Divider(height: 1, color: ink.withValues(alpha: 0.06)),
_tile(
Icons.auto_awesome_outlined,
'体验示例课表',
'无需登录,看看河畔的样子',
'无需登录,预览课表样式',
controller.showDemo,
),
],
@@ -225,7 +210,7 @@ class ProfilePage extends StatelessWidget {
child: Column(
children: [
const Text(
'河畔Everyday',
'Riverside Schedule',
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600),
),
const SizedBox(height: 6),