docs(wiki): 更新 Wiki 文档

- Home.md: 新增 EPUB 阅读、布局设置功能概览

- Pages-and-Navigation.md: 新增影视墙/书架模式说明、添加按钮规范

- Theme-and-UI.md: 新增布局设置界面、标签选择面板文档

- User-Preferences.md: 新增布局设置、排序方式、影视墙/书架模式配置
This commit is contained in:
DelLevin-Home
2026-07-02 20:19:07 +08:00
parent 30a002feb2
commit 44d69fde04
4 changed files with 149 additions and 86 deletions

View File

@@ -4,91 +4,65 @@
`lib/utils/user_prefs.dart` — SharedPreferences 单例包装器。
```dart
class UserPrefs {
static final UserPrefs _instance = UserPrefs._internal();
factory UserPrefs() => _instance;
}
```
### 布局设置
使用前必须调用 `UserPrefs.init()`(在 `main.dart` 中完成)。
| 偏好项 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
| `movieLayoutStyle` | int | 0 | 影视布局0=海报网格, 1=列表, 2=大图卡片 |
| `bookLayoutStyle` | int | 0 | 阅读布局0=封面网格, 1=列表 |
| `noteLayoutStyle` | int | 0 | 笔记布局0=列表, 1=瀑布流, 2=时间线 |
| `movieWallMode` | bool | false | 影视墙模式:显示全部影片,不区分状态 |
| `bookshelfMode` | bool | false | 书架模式:显示全部书籍,不区分状态 |
## 配置项列表
### 排序方式
### 用户信息
| 偏好项 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
| `movieSortMode` | int | 0 | 影视排序0=更新时间, 1=创建时间, 2=评分 |
| `bookSortMode` | int | 0 | 书籍排序0=更新时间, 1=创建时间, 2=评分 |
| `noteSortMode` | int | 0 | 笔记排序0=更新时间, 1=创建时间 |
| 键 | 类型 | 默认值 | 说明 |
|----|------|--------|------|
| `nickname` | String | `'Mook'` | 昵称 |
| `motto` | String | `'好运不会眷顾一无所有之人。'` | 座右铭 |
| `avatarPath` | String? | `null` | 头像本地路径 |
### 主界面标签显示
### 应用设置
| 偏好项 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
| `showMovieTab` | bool | true | 显示影视标签 |
| `showBookTab` | bool | true | 显示阅读标签 |
| `showNoteTab` | bool | true | 显示笔记标签 |
| `showNotePlusTab` | bool | false | 显示 Note Plus 标签 |
| `defaultMainTabIndex` | int | 0 | 默认启动标签 |
| 键 | 类型 | 默认值 | 说明 |
|----|------|--------|------|
| `themeMode` | int | `0` | 0=跟随系统, 1=浅色, 2=深色 |
| `showExactReleaseDate` | bool | `true` | 上映日期显示到日/月 |
| `isFirstLaunch` | bool | `true` | 是否首次启动 |
### 主题设置
### 主界面显示
| 偏好项 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
| `themeMode` | int | 0 | 0=跟随系统, 1=浅色, 2=深色 |
| `colorSchemeIndex` | int | 0 | 配色方案0=经典, 1=靛蓝, 2=薄荷, 3=琥珀, 4=玫瑰, 5=紫罗兰 |
| `fontFamily` | String | '' | 字体,空字符串=系统默认 |
| 键 | 类型 | 默认值 | 说明 |
|----|------|--------|------|
| `hideBottomNavOnScroll` | bool | `true` | 滚动时隐藏底部导航 |
| `showMovieTab` | bool | `true` | 是否显示观影标签 |
| `showBookTab` | bool | `true` | 是否显示阅读标签 |
| `showNoteTab` | bool | `true` | 是否显示笔记标签 |
| `defaultMainTabIndex` | int | `0` | 默认启动标签0=影视, 1=阅读, 2=笔记)|
### 侧边栏功能开关
### 布局样式
| 偏好项 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
| `showSidebarHeatmap` | bool | true | 热力图 |
| `showSidebarRecent` | bool | true | 最近添加 |
| `showSidebarEncounter` | bool | true | 随机邂逅 |
| `showSidebarStroll` | bool | true | 漫步 |
| `showSidebarCalendar` | bool | true | 日历 |
| `showSidebarPerson` | bool | true | 人物 |
| `showSidebarTags` | bool | true | 标签 |
| `showSidebarMdReader` | bool | false | Markdown 阅读器 |
| `showSidebarEpub` | bool | true | EPUB 阅读器 |
| 键 | 类型 | 默认值 | 说明 |
|----|------|--------|------|
| `noteLayoutStyle` | int | `0` | 笔记布局0=列表, 1=瀑布流, 2=时间线)|
| `movieLayoutStyle` | int | `0` | 影视布局0=海报网格, 1=列表)|
| `bookLayoutStyle` | int | `0` | 阅读布局0=封面网格, 1=列表)|
### 其他设置
### Markdown 阅读器
| 键 | 类型 | 默认值 | 说明 |
|----|------|--------|------|
| `lastMdFolder` | String? | `null` | 最近选择的目录 |
| `showEmptyDirs` | bool | `true` | 是否显示空目录 |
| `showImageOnlyDirs` | bool | `true` | 是否显示纯图片目录 |
### 应用图标
| 键 | 类型 | 默认值 | 说明 |
|----|------|--------|------|
| `appIconName` | String | `'app_icon'` | 当前应用图标名称 |
### 用户统计
| 键 | 类型 | 默认值 | 说明 |
|----|------|--------|------|
| `deviceId` | String | `''` | 匿名设备标识(首次启动自动生成)|
### 服务端同步
| 键 | 类型 | 默认值 | 说明 |
|----|------|--------|------|
| `syncServerUrl` | String | `''` | 服务器地址 |
| `syncActivationCode` | String | `''` | 激活码 |
| `syncExpiresAt` | String | `''` | 激活码有效期 |
| `syncIsPermanent` | bool | `false` | 是否永久有效 |
| `syncEnabled` | bool | `true` | 实时同步开关 |
| `syncLastEntryId` | int | `0` | 上次同步的 entry ID |
## 主题模式迁移
`UserPrefs.init()` 中包含旧版 `isDarkMode`(布尔值)到新版 `themeMode`(三态值)的自动迁移:
```dart
if (_prefs!.containsKey('isDarkMode') && !_prefs!.containsKey('themeMode')) {
final oldValue = _prefs!.getBool('isDarkMode') ?? false;
await _prefs!.setInt('themeMode', oldValue ? 2 : 0);
}
```
| 偏好项 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
| `hideBottomNavOnScroll` | bool | true | 滚动时隐藏底部导航栏 |
| `showExactReleaseDate` | bool | true | 上映日期显示到日false=显示到月) |
| `detailPageStyle` | int | 0 | 详情页样式0=标准, 1=叠层 |
| `epubFontSize` | double | 18.0 | EPUB 阅读器字体大小 |
| `epubViewMode` | int | 0 | EPUB 书架视图0=宽松, 1=紧凑 |
| `highlightsViewMode` | int | 0 | 摘抄视图0=瀑布流, 1=列表 |
[返回首页](Home.md)