mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 01:02:14 +08:00
Deletes Note.compareTo
Notes should no longer have a default comparison method. Since sorting will soon be configurable (and is currently disabled), lets just remove this method.
This commit is contained in:
@ -16,7 +16,7 @@ enum NoteLoadState {
|
|||||||
NotExists,
|
NotExists,
|
||||||
}
|
}
|
||||||
|
|
||||||
class Note with ChangeNotifier implements Comparable<Note> {
|
class Note with ChangeNotifier {
|
||||||
NotesFolder parent;
|
NotesFolder parent;
|
||||||
String _filePath;
|
String _filePath;
|
||||||
|
|
||||||
@ -204,19 +204,4 @@ class Note with ChangeNotifier implements Comparable<Note> {
|
|||||||
String toString() {
|
String toString() {
|
||||||
return 'Note{filePath: $_filePath, created: $created, modified: $modified, data: $_data}';
|
return 'Note{filePath: $_filePath, created: $created, modified: $modified, data: $_data}';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
int compareTo(Note other) {
|
|
||||||
if (other == null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var dt = modified ?? created ?? _fileLastModified;
|
|
||||||
var otherDt = other.modified ?? other.created ?? other._fileLastModified;
|
|
||||||
if (dt == null || otherDt == null) {
|
|
||||||
return _filePath.compareTo(other._filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dt.compareTo(otherDt);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user