Files
GitJournal/lib/core/virtual_notes_folder.dart
Vishesh Handa fe08b53539 Add a .gitjournal.yaml file in a folder
This file will be added to save the settings of how we want that folder
to behave. For example - default Editor, view, sorting mode, etc.

This feature is currently disabled as it will only be a part of the pro
mode.
2020-03-31 14:02:38 +02:00

47 lines
874 B
Dart

import 'note.dart';
import 'notes_folder.dart';
import 'notes_folder_notifier.dart';
class VirtualNotesFolder with NotesFolderNotifier implements NotesFolder {
final List<Note> _notes;
VirtualNotesFolder(this._notes);
@override
List<Note> get notes => _notes;
@override
List<NotesFolder> get subFolders => [];
@override
bool get isEmpty => _notes.isEmpty;
@override
bool get hasNotes => _notes.isNotEmpty;
@override
NotesFolder get parent => null;
@override
String pathSpec() => "";
@override
String get name => "";
@override
NotesFolder get fsFolder {
return null;
}
@override
NotesFolderConfig get config {
return NotesFolderConfig.fromSettings(fsFolder);
}
@override
set config(NotesFolderConfig conf) {
assert(false, "A Virtual Notes Folder Config cannot change");
conf.saveToSettings();
}
}