mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 18:07:50 -06:00
fix: Refactor labels structure
This commit is contained in:
@@ -13,6 +13,12 @@ class DocumentSearchState extends DocumentPagingState {
|
||||
final List<String> suggestions;
|
||||
@JsonKey()
|
||||
final ViewType viewType;
|
||||
|
||||
final Map<int, Correspondent> correspondents;
|
||||
final Map<int, DocumentType> documentTypes;
|
||||
final Map<int, Tag> tags;
|
||||
final Map<int, StoragePath> storagePaths;
|
||||
|
||||
const DocumentSearchState({
|
||||
this.view = SearchView.suggestions,
|
||||
this.searchHistory = const [],
|
||||
@@ -22,6 +28,10 @@ class DocumentSearchState extends DocumentPagingState {
|
||||
super.hasLoaded,
|
||||
super.isLoading,
|
||||
super.value,
|
||||
this.correspondents = const {},
|
||||
this.documentTypes = const {},
|
||||
this.tags = const {},
|
||||
this.storagePaths = const {},
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -31,6 +41,10 @@ class DocumentSearchState extends DocumentPagingState {
|
||||
suggestions,
|
||||
view,
|
||||
viewType,
|
||||
correspondents,
|
||||
documentTypes,
|
||||
tags,
|
||||
storagePaths,
|
||||
];
|
||||
|
||||
@override
|
||||
@@ -57,6 +71,10 @@ class DocumentSearchState extends DocumentPagingState {
|
||||
List<String>? suggestions,
|
||||
SearchView? view,
|
||||
ViewType? viewType,
|
||||
Map<int, Correspondent>? correspondents,
|
||||
Map<int, DocumentType>? documentTypes,
|
||||
Map<int, Tag>? tags,
|
||||
Map<int, StoragePath>? storagePaths,
|
||||
}) {
|
||||
return DocumentSearchState(
|
||||
value: value ?? this.value,
|
||||
@@ -67,6 +85,10 @@ class DocumentSearchState extends DocumentPagingState {
|
||||
view: view ?? this.view,
|
||||
suggestions: suggestions ?? this.suggestions,
|
||||
viewType: viewType ?? this.viewType,
|
||||
correspondents: correspondents ?? this.correspondents,
|
||||
documentTypes: documentTypes ?? this.documentTypes,
|
||||
tags: tags ?? this.tags,
|
||||
storagePaths: storagePaths ?? this.storagePaths,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user