Sort by filename if file last modified is the same

Related to #172
This commit is contained in:
Vishesh Handa
2021-08-09 10:47:35 +02:00
parent f24740ea3a
commit 879e238428

View File

@ -193,6 +193,9 @@ int _sortModifiedDesc(Note a, Note b) {
} else if (a.fileLastModified != null && b.fileLastModified == null) {
return -1;
} else if (a.fileLastModified != null && b.fileLastModified != null) {
if (a.fileLastModified! == b.fileLastModified!) {
return a.fileName.compareTo(b.fileName);
}
return a.fileLastModified!.compareTo(b.fileLastModified!);
} else {
return a.fileName.compareTo(b.fileName);