fix: Refactor labels structure

This commit is contained in:
Anton Stubenbord
2023-04-05 19:44:58 +02:00
parent a2388b014b
commit 79ccdd0946
35 changed files with 357 additions and 234 deletions

View File

@@ -1,11 +1,20 @@
part of 'similar_documents_cubit.dart';
class SimilarDocumentsState extends DocumentPagingState {
final Map<int, Correspondent> correspondents;
final Map<int, DocumentType> documentTypes;
final Map<int, Tag> tags;
final Map<int, StoragePath> storagePaths;
const SimilarDocumentsState({
super.filter,
super.hasLoaded,
super.isLoading,
super.value,
this.correspondents = const {},
this.documentTypes = const {},
this.tags = const {},
this.storagePaths = const {},
});
@override
@@ -14,6 +23,10 @@ class SimilarDocumentsState extends DocumentPagingState {
hasLoaded,
isLoading,
value,
correspondents,
documentTypes,
tags,
storagePaths,
];
@override
@@ -36,12 +49,20 @@ class SimilarDocumentsState extends DocumentPagingState {
bool? isLoading,
List<PagedSearchResult<DocumentModel>>? value,
DocumentFilter? filter,
Map<int, Correspondent>? correspondents,
Map<int, DocumentType>? documentTypes,
Map<int, Tag>? tags,
Map<int, StoragePath>? storagePaths,
}) {
return SimilarDocumentsState(
hasLoaded: hasLoaded ?? this.hasLoaded,
isLoading: isLoading ?? this.isLoading,
value: value ?? this.value,
filter: filter ?? this.filter,
correspondents: correspondents ?? this.correspondents,
documentTypes: documentTypes ?? this.documentTypes,
tags: tags ?? this.tags,
storagePaths: storagePaths ?? this.storagePaths,
);
}
}