mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 18:03:14 +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;
|
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() {
|
List<Note> getNotes() {
|
||||||
return _entities.where((e) => e.isNote).map((e) => e.note).toList();
|
return _entities.where((e) => e.isNote).map((e) => e.note).toList();
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,8 @@ import 'package:gitjournal/themes.dart';
|
|||||||
|
|
||||||
class JournalListingScreen extends StatelessWidget {
|
class JournalListingScreen extends StatelessWidget {
|
||||||
final NotesFolder notesFolder;
|
final NotesFolder notesFolder;
|
||||||
final bool recursive;
|
|
||||||
|
|
||||||
JournalListingScreen({@required this.notesFolder, this.recursive = false});
|
JournalListingScreen({@required this.notesFolder});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -27,8 +26,7 @@ class JournalListingScreen extends StatelessWidget {
|
|||||||
child: Icon(Icons.add),
|
child: Icon(Icons.add),
|
||||||
);
|
);
|
||||||
|
|
||||||
var allNotes =
|
var allNotes = notesFolder.getNotes();
|
||||||
recursive ? notesFolder.getAllNotes() : notesFolder.getNotes();
|
|
||||||
allNotes.sort((a, b) => b.compareTo(a));
|
allNotes.sort((a, b) => b.compareTo(a));
|
||||||
|
|
||||||
Widget journalList = JournalList(
|
Widget journalList = JournalList(
|
||||||
|
Reference in New Issue
Block a user