mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00

Stop it being a singleton. This means it needs to be passed around a lot. This sucks, but it's how it should be. I shouldn't be using a global variable to get around this. This is needed as Settings will soon become repo specific when we support multiple repos. This breaks saving the settings in a file, that feature was toggled off anyway. It needs to be thought over again.
46 lines
860 B
Dart
46 lines
860 B
Dart
import 'package:gitjournal/settings.dart';
|
|
import 'note.dart';
|
|
import 'notes_folder.dart';
|
|
import 'notes_folder_notifier.dart';
|
|
|
|
class VirtualNotesFolder with NotesFolderNotifier implements NotesFolder {
|
|
final List<Note> _notes;
|
|
final Settings settings;
|
|
|
|
VirtualNotesFolder(this._notes, this.settings);
|
|
|
|
@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
|
|
String get publicName => "";
|
|
|
|
@override
|
|
NotesFolder get fsFolder {
|
|
return null;
|
|
}
|
|
|
|
@override
|
|
NotesFolderConfig get config {
|
|
return NotesFolderConfig.fromSettings(null, settings);
|
|
}
|
|
}
|