Files
paperless-mobile/lib/features/linked_documents/cubit/linked_documents_state.dart

57 lines
1.3 KiB
Dart

part of 'linked_documents_cubit.dart';
@JsonSerializable(ignoreUnannotated: true)
class LinkedDocumentsState extends DocumentPagingState {
@JsonKey()
final ViewType viewType;
const LinkedDocumentsState({
this.viewType = ViewType.list,
super.filter,
super.isLoading,
super.hasLoaded,
super.value,
});
LinkedDocumentsState copyWith({
DocumentFilter? filter,
bool? isLoading,
bool? hasLoaded,
List<PagedSearchResult<DocumentModel>>? value,
ViewType? viewType,
}) {
return LinkedDocumentsState(
filter: filter ?? this.filter,
isLoading: isLoading ?? this.isLoading,
hasLoaded: hasLoaded ?? this.hasLoaded,
value: value ?? this.value,
viewType: viewType ?? this.viewType,
);
}
@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 => [
viewType,
...super.props,
];
factory LinkedDocumentsState.fromJson(Map<String, dynamic> json) =>
_$LinkedDocumentsStateFromJson(json);
Map<String, dynamic> toJson() => _$LinkedDocumentsStateToJson(this);
}