mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +08:00
FolderListing: Show the number of notes per folder
This commit is contained in:
@ -29,6 +29,14 @@ class NotesFolder {
|
||||
return entities.firstWhere((e) => e.isNote, orElse: () => null) != null;
|
||||
}
|
||||
|
||||
int get numberOfNotes {
|
||||
int i = 0;
|
||||
entities.forEach((e) {
|
||||
if (e.isNote) i++;
|
||||
});
|
||||
return i;
|
||||
}
|
||||
|
||||
// Recurisvely gets all Notes within this folder
|
||||
List<Note> getAllNotes() {
|
||||
var notes = <Note>[];
|
||||
|
@ -70,11 +70,13 @@ class FolderTileState extends State<FolderTile> {
|
||||
if (folder.parent == null) {
|
||||
folderName = "Notes";
|
||||
}
|
||||
var subtitle = folder.numberOfNotes.toString() + " Notes";
|
||||
|
||||
return Card(
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.folder),
|
||||
title: Text(folderName),
|
||||
subtitle: Text(subtitle),
|
||||
trailing: trailling,
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user