part of 'documents_cubit.dart'; class DocumentsState extends DocumentPagingState { final List selection; final Map correspondents; final Map documentTypes; final Map tags; final Map storagePaths; final ViewType viewType; const DocumentsState({ this.selection = const [], this.viewType = ViewType.list, super.value = const [], super.filter = const DocumentFilter(), super.hasLoaded = false, super.isLoading = false, this.correspondents = const {}, this.documentTypes = const {}, this.tags = const {}, this.storagePaths = const {}, }); List get selectedIds => selection.map((e) => e.id).toList(); DocumentsState copyWith({ bool? hasLoaded, bool? isLoading, List>? value, DocumentFilter? filter, List? selection, ViewType? viewType, Map? correspondents, Map? documentTypes, Map? tags, Map? storagePaths, }) { return DocumentsState( hasLoaded: hasLoaded ?? this.hasLoaded, isLoading: isLoading ?? this.isLoading, value: value ?? this.value, filter: filter ?? this.filter, selection: selection ?? this.selection, viewType: viewType ?? this.viewType, correspondents: correspondents ?? this.correspondents, documentTypes: documentTypes ?? this.documentTypes, tags: tags ?? this.tags, storagePaths: storagePaths ?? this.storagePaths, ); } @override List get props => [ selection, viewType, correspondents, documentTypes, tags, storagePaths, super.filter, super.hasLoaded, super.isLoading, super.value, ]; @override DocumentsState copyWithPaged({ bool? hasLoaded, bool? isLoading, List>? value, DocumentFilter? filter, }) { return copyWith( filter: filter, hasLoaded: hasLoaded, isLoading: isLoading, value: value, ); } }