WIP - more decoupling of blocs

This commit is contained in:
Anton Stubenbord
2022-12-12 01:29:34 +01:00
parent e2a20cea75
commit 2f31d9c053
51 changed files with 1083 additions and 800 deletions

View File

@@ -64,4 +64,7 @@ class CorrespondentRepositoryImpl implements LabelRepository<Correspondent> {
void clear() {
_subject.add(const {});
}
@override
Map<int, Correspondent> get current => _subject.value;
}

View File

@@ -63,4 +63,7 @@ class DocumentTypeRepositoryImpl implements LabelRepository<DocumentType> {
void clear() {
_subject.add(const {});
}
@override
Map<int, DocumentType> get current => _subject.value;
}

View File

@@ -63,4 +63,7 @@ class StoragePathRepositoryImpl implements LabelRepository<StoragePath> {
void clear() {
_subject.add(const {});
}
@override
Map<int, StoragePath> get current => _subject.value;
}

View File

@@ -62,4 +62,7 @@ class TagRepositoryImpl implements LabelRepository<Tag> {
void clear() {
_subject.add(const {});
}
@override
Map<int, Tag> get current => _subject.value;
}

View File

@@ -3,6 +3,8 @@ import 'package:paperless_api/paperless_api.dart';
abstract class LabelRepository<T extends Label> {
Stream<Map<int, T>> get labels;
Map<int, T> get current;
Future<T> create(T label);
Future<T?> find(int id);
Future<Iterable<T>> findAll([Iterable<int>? ids]);