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:
Vishesh Handa
2019-12-09 00:53:53 +01:00
parent 6c10fa8a0f
commit ca83cb79a6
2 changed files with 2 additions and 18 deletions

View File

@ -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();
}

View File

@ -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(