Files
GitJournal/lib/core/virtual_notes_folder.dart
Vishesh Handa 9499cea164 Remove Settings global
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.
2020-10-09 00:59:19 +02:00

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