Add an 'All' folder to the local favorites page. Close #335

This commit is contained in:
2025-04-22 20:19:22 +08:00
parent a29a7cbaf3
commit 62e4056f4a
6 changed files with 119 additions and 114 deletions

View File

@@ -102,13 +102,6 @@ class _LeftBarState extends State<_LeftBar> implements FolderList {
const Spacer(),
MenuButton(
entries: [
MenuEntry(
icon: Icons.search,
text: 'Search'.tl,
onClick: () {
context.to(() => const LocalSearchPage());
},
),
MenuEntry(
icon: Icons.add,
text: 'Create Folder'.tl,
@@ -140,6 +133,10 @@ class _LeftBarState extends State<_LeftBar> implements FolderList {
);
}
index--;
if (index == 0) {
return buildLocalFolder(_localAllFolderLabel);
}
index--;
if (index < folders.length) {
return buildLocalFolder(folders[index]);
}
@@ -214,7 +211,9 @@ class _LeftBarState extends State<_LeftBar> implements FolderList {
),
),
padding: const EdgeInsets.only(left: 16),
child: Text(name),
child: Text(name == _localAllFolderLabel
? "All".tl
: getFavoriteDataOrNull(name)?.title ?? name),
),
);
}