FolderView: Show the correct title

This commit is contained in:
Vishesh Handa
2020-03-21 00:19:57 +01:00
parent 610c4ea8a7
commit 22c9d1208a

View File

@ -88,9 +88,15 @@ class _FolderViewState extends State<FolderView> {
child: Icon(Icons.add),
);
var title = widget.notesFolder.parent == null
? "Notes"
// If this is a Virtual folder which doesn't overwrite the FS folder's name
// then we should use it's given name as the title
String title = widget.notesFolder.name;
var fsFolder = widget.notesFolder.fsFolder;
if (fsFolder.name == widget.notesFolder.name) {
title = widget.notesFolder.parent == null
? "Root Folder"
: widget.notesFolder.pathSpec();
}
var folderView = Builder(
builder: (BuildContext context) {