mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 09:06:43 +08:00
JournalListing: Remove recursive option
We aren't using it, and if we implement a recursive option it should somehow showcase which folder it is under. Evernote does it in an interesting way.
This commit is contained in:
@ -56,20 +56,6 @@ class NotesFolder with ChangeNotifier {
|
||||
return i;
|
||||
}
|
||||
|
||||
// Recurisvely gets all Notes within this folder
|
||||
List<Note> getAllNotes() {
|
||||
var notes = <Note>[];
|
||||
|
||||
for (var entity in _entities) {
|
||||
if (entity.isNote) {
|
||||
notes.add(entity.note);
|
||||
} else {
|
||||
notes.addAll(entity.folder.getAllNotes());
|
||||
}
|
||||
}
|
||||
return notes;
|
||||
}
|
||||
|
||||
List<Note> getNotes() {
|
||||
return _entities.where((e) => e.isNote).map((e) => e.note).toList();
|
||||
}
|
||||
|
@ -13,9 +13,8 @@ import 'package:gitjournal/themes.dart';
|
||||
|
||||
class JournalListingScreen extends StatelessWidget {
|
||||
final NotesFolder notesFolder;
|
||||
final bool recursive;
|
||||
|
||||
JournalListingScreen({@required this.notesFolder, this.recursive = false});
|
||||
JournalListingScreen({@required this.notesFolder});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -27,8 +26,7 @@ class JournalListingScreen extends StatelessWidget {
|
||||
child: Icon(Icons.add),
|
||||
);
|
||||
|
||||
var allNotes =
|
||||
recursive ? notesFolder.getAllNotes() : notesFolder.getNotes();
|
||||
var allNotes = notesFolder.getNotes();
|
||||
allNotes.sort((a, b) => b.compareTo(a));
|
||||
|
||||
Widget journalList = JournalList(
|
||||
|
Reference in New Issue
Block a user