界面功能优化

This commit is contained in:
DelLevin-Home
2026-05-23 13:39:51 +08:00
parent 231d84fab6
commit 0b28dfffaa
15 changed files with 1426 additions and 888 deletions

View File

@@ -482,11 +482,15 @@ class BackupService {
if (data.containsKey('tags')) {
final tags = data['tags'] as List<dynamic>;
for (final tag in tags) {
await txn.insert('tags', _convertToDbMap(tag));
final map = _convertToDbMap(tag);
await txn.rawInsert(
'INSERT OR IGNORE INTO tags (id, name, type, created_at) VALUES (?, ?, ?, ?)',
[map['id'], map['name'], map['type'], map['created_at']],
);
}
}
});
// 恢复用户个人信息
if (backupData.containsKey('userInfo')) {
final userInfo = backupData['userInfo'] as Map<String, dynamic>;
@@ -644,7 +648,11 @@ class BackupService {
if (data.containsKey('tags')) {
final tags = data['tags'] as List<dynamic>;
for (final tag in tags) {
await txn.insert('tags', _convertToDbMap(tag));
final map = _convertToDbMap(tag);
await txn.rawInsert(
'INSERT OR IGNORE INTO tags (id, name, type, created_at) VALUES (?, ?, ?, ?)',
[map['id'], map['name'], map['type'], map['created_at']],
);
}
}
});

View File

@@ -64,6 +64,14 @@ class UserPrefs {
bool get showNoteTab => prefs.getBool('showNoteTab') ?? true;
Future<bool> setShowNoteTab(bool value) => prefs.setBool('showNoteTab', value);
/// 默认启动标签 (0: 影视, 1: 阅读, 2: 笔记)
int get defaultMainTabIndex => prefs.getInt('defaultMainTabIndex') ?? 0;
Future<bool> setDefaultMainTabIndex(int value) => prefs.setInt('defaultMainTabIndex', value);
/// 笔记布局样式 (0: 列表, 1: 瀑布流)
int get noteLayoutStyle => prefs.getInt('noteLayoutStyle') ?? 0;
Future<bool> setNoteLayoutStyle(int value) => prefs.setInt('noteLayoutStyle', value);
// ========== 应用图标设置 ==========
/// Markdown 阅读器最近选择的目录