feat: deliver Riverside Schedule seven-day grid and school HTML import
This commit is contained in:
@@ -40,6 +40,7 @@ class _ImportPreviewState extends State<ImportPreview> {
|
||||
'${draft.courses.length} 条课程安排 · ${draft.source == CourseSource.demo ? '示例体验' : '导入预览'}',
|
||||
style: const TextStyle(color: river),
|
||||
),
|
||||
if (draft.semesterLabel != null) Text('学期:${draft.semesterLabel}'),
|
||||
const SizedBox(height: 18),
|
||||
if (empty)
|
||||
Text(draft.explicitlyEmpty ? '此操作会清空当前课表。' : '没有识别到课程,当前课表保持不变。'),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -78,7 +78,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('关闭日历同步'),
|
||||
content: const Text('是否删除河畔创建的课程日程?其他日程不会受影响。'),
|
||||
content: const Text('是否删除Riverside Schedule 创建的课程日程?其他日程不会受影响。'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
|
||||
Reference in New Issue
Block a user