feat: view type stored in view/cubit, itself, cleanup coe

This commit is contained in:
Anton Stubenbord
2023-02-10 12:41:30 +01:00
parent e65e152d44
commit f04edece16
72 changed files with 307 additions and 568 deletions

View File

@@ -0,0 +1,48 @@
part of 'linked_documents_cubit.dart';
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,
];
}