mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 18:07:50 -06:00
WIP - Reimplemented document search
This commit is contained in:
@@ -1,13 +1,48 @@
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/features/paged_document_view/model/paged_documents_state.dart';
|
||||
|
||||
class LinkedDocumentsState {
|
||||
final bool isLoaded;
|
||||
final PagedSearchResult<DocumentModel>? documents;
|
||||
final DocumentFilter filter;
|
||||
|
||||
LinkedDocumentsState({
|
||||
required this.filter,
|
||||
this.isLoaded = false,
|
||||
this.documents,
|
||||
class LinkedDocumentsState extends PagedDocumentsState {
|
||||
const LinkedDocumentsState({
|
||||
super.filter,
|
||||
super.isLoading,
|
||||
super.hasLoaded,
|
||||
super.value,
|
||||
});
|
||||
|
||||
LinkedDocumentsState copyWith({
|
||||
DocumentFilter? filter,
|
||||
bool? isLoading,
|
||||
bool? hasLoaded,
|
||||
List<PagedSearchResult<DocumentModel>>? value,
|
||||
}) {
|
||||
return LinkedDocumentsState(
|
||||
filter: filter ?? this.filter,
|
||||
isLoading: isLoading ?? this.isLoading,
|
||||
hasLoaded: hasLoaded ?? this.hasLoaded,
|
||||
value: value ?? this.value,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
LinkedDocumentsState copyWithPaged({
|
||||
bool? hasLoaded,
|
||||
bool? isLoading,
|
||||
List<PagedSearchResult<DocumentModel>>? value,
|
||||
DocumentFilter? filter,
|
||||
}) {
|
||||
return copyWith(
|
||||
hasLoaded: hasLoaded,
|
||||
isLoading: isLoading,
|
||||
value: value,
|
||||
filter: filter,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
filter,
|
||||
isLoading,
|
||||
hasLoaded,
|
||||
value,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user