前端
- 移除全部 Avalonia 依赖,模型渲染与界面统一改用 Flutter
- 新增用户页:登录/注册(SHA-512 + 盐)、签到积分(30 天一循环)、
主题色积分购买、二选一随机、今日人品
- 新增百宝箱页、模型内嵌渲染页、自绘标题栏(最小化/最大化/关闭)
- 下载页显示模型下载进度条,下载源读取加速
- 关于页新增「重新下载启动器」并在下载后做 sha256 完整性校验
- 修复浅色主题下标题栏不跟随主题色、无法连接后端等问题
后端
- 新增 UserService:.GC/user/<用户名>.yaml 存用户名/积分/SHA-512 口令,
登录返回 session token,本地 .GC/user/user.yaml 保存登录态
- 新增 /api/user/{register,login,me,signin,theme} 接口
- 去掉 Avalonia 窗口宿主,后端只提供 HTTP API
下载源
- 新增 GitHub 镜像源(Morris-morris-cloud/GC),与 Xhmcl 并发测速
- 单源探测超时收紧到 2 秒,取最快且可用的源;GitHub 复用 GiteaRemote
(contents 带 ref、releases 带 per_page=100)
构建与 CI
- macOS 上默认只出 macOS 包,Windows 交给原生 Windows 构建
- 修复 Windows 交叉编译中 flutter-cpp-client-wrapper 双层目录嵌套
- 新增 GitHub Actions:
· nightly-prerelease:每天 21:00 编译三平台,发布 nightly 预发布
· build-bot:Issue/PR 评论 @build-bot build <mac|win-amd|win-arm|all>,
发布 ip-prerelease 预发布
· pr-review:检查能否编译、静态分析、合并冲突、是否落后 main
- 忽略 79MB 课件产物等高线.html 与工具链临时备份
120 lines
3.6 KiB
Dart
120 lines
3.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../i18n.dart';
|
|
import '../models/base.dart';
|
|
import '../models/lookup.dart';
|
|
import '../theme.dart';
|
|
|
|
/// 模型视图:在壳内直接渲染 Flutter 模型。
|
|
///
|
|
/// 以前「启动模型」是让后端另开一个 Avalonia 窗口;现在模型全部是 Flutter 实现,
|
|
/// 直接换掉内容区即可 —— 不会多出一个窗口,也不用跨进程传状态。
|
|
class ModelViewPage extends StatelessWidget {
|
|
const ModelViewPage({
|
|
super.key,
|
|
required this.modelId,
|
|
required this.onClose,
|
|
});
|
|
|
|
final String modelId;
|
|
final VoidCallback onClose;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final model = flutterModelFor(modelId);
|
|
|
|
if (model == null) {
|
|
return Center(
|
|
child: GcCard(
|
|
padding: const EdgeInsets.all(GcSpace.xxl),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Text(
|
|
T('model.missing'),
|
|
style: TextStyle(
|
|
fontSize: 15,
|
|
height: 1.35,
|
|
fontWeight: FontWeight.w600,
|
|
color: GcColors.ink,
|
|
),
|
|
),
|
|
const SizedBox(height: GcSpace.sm),
|
|
GcHint(T('model.missingHint')),
|
|
const SizedBox(height: GcSpace.lg),
|
|
OutlinedButton(
|
|
onPressed: onClose,
|
|
child: Text(T('model.back')),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: <Widget>[
|
|
Padding(
|
|
padding: const EdgeInsets.fromLTRB(
|
|
GcSpace.xxl,
|
|
GcSpace.lg,
|
|
GcSpace.xxl,
|
|
GcSpace.sm,
|
|
),
|
|
child: Row(
|
|
children: <Widget>[
|
|
OutlinedButton.icon(
|
|
onPressed: onClose,
|
|
icon: const Icon(Icons.arrow_back_rounded, size: 16),
|
|
label: Text(T('model.back')),
|
|
),
|
|
const SizedBox(width: GcSpace.lg),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: <Widget>[
|
|
Text(
|
|
model.name(),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
height: 1.3,
|
|
fontWeight: FontWeight.w600,
|
|
color: GcColors.ink,
|
|
),
|
|
),
|
|
const SizedBox(height: 2),
|
|
Text(
|
|
model.description(),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
fontSize: 12,
|
|
height: 1.4,
|
|
color: GcColors.faint,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Expanded(child: ClipRect(child: _body(model))),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _body(GcModel model) {
|
|
// 模型视图自己管状态(动画、视角),换 id 时必须重建,不能复用 State
|
|
return KeyedSubtree(
|
|
key: ValueKey<String>(model.id),
|
|
child: Builder(builder: (context) => model.buildView(context)),
|
|
);
|
|
}
|
|
}
|