测试块编辑器笔记

This commit is contained in:
DelLevin-Home
2026-06-26 05:53:40 +08:00
parent 22797603f5
commit f7ef50a677
20 changed files with 3743 additions and 1 deletions

View File

@@ -1100,6 +1100,7 @@ class _MainContentSettingsPageState extends State<MainContentSettingsPage> {
bool _showMovieTab = true;
bool _showBookTab = true;
bool _showNoteTab = true;
bool _showNotePlusTab = false;
int _defaultTabIndex = 0;
@override
@@ -1113,6 +1114,7 @@ class _MainContentSettingsPageState extends State<MainContentSettingsPage> {
_showMovieTab = _userPrefs.showMovieTab;
_showBookTab = _userPrefs.showBookTab;
_showNoteTab = _userPrefs.showNoteTab;
_showNotePlusTab = _userPrefs.showNotePlusTab;
_defaultTabIndex = _userPrefs.defaultMainTabIndex;
});
}
@@ -1143,6 +1145,11 @@ class _MainContentSettingsPageState extends State<MainContentSettingsPage> {
setState(() => _showNoteTab = value);
}
Future<void> _toggleNotePlusTab(bool value) async {
await _userPrefs.setShowNotePlusTab(value);
setState(() => _showNotePlusTab = value);
}
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
@@ -1161,6 +1168,8 @@ class _MainContentSettingsPageState extends State<MainContentSettingsPage> {
Divider(height: 0.5, indent: 24, endIndent: 24, color: colors.outlineVariant),
_buildSwitchItem(Icons.note_outlined, '笔记', '记录和管理笔记', _showNoteTab, _toggleNoteTab),
Divider(height: 0.5, indent: 24, endIndent: 24, color: colors.outlineVariant),
_buildSwitchItem(Icons.edit_note, 'Note Plus', '块编辑器,支持富文本文档', _showNotePlusTab, _toggleNotePlusTab),
Divider(height: 0.5, indent: 24, endIndent: 24, color: colors.outlineVariant),
Container(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 10),
child: Text('至少保留一个模块,关闭后对应标签页将不再显示。', style: TextStyle(fontSize: 11, color: colors.onSurface.withValues(alpha: 0.3))),