53 lines
1.3 KiB
Dart
53 lines
1.3 KiB
Dart
|
|
part of 'operation_files_bloc.dart';
|
||
|
|
|
||
|
|
enum OperationFilesStatus { initial, loading, uploading, success, failure }
|
||
|
|
|
||
|
|
class OperationFilesState extends Equatable {
|
||
|
|
const OperationFilesState({
|
||
|
|
this.operationId,
|
||
|
|
required this.status,
|
||
|
|
this.error,
|
||
|
|
this.localFiles = const [],
|
||
|
|
this.remoteFiles = const [],
|
||
|
|
this.selectedFiles = const [],
|
||
|
|
});
|
||
|
|
|
||
|
|
final String? operationId;
|
||
|
|
final OperationFilesStatus status;
|
||
|
|
final String? error;
|
||
|
|
final List<AttachmentModel> localFiles;
|
||
|
|
final List<AttachmentModel> remoteFiles;
|
||
|
|
|
||
|
|
final List<AttachmentModel> selectedFiles;
|
||
|
|
|
||
|
|
@override
|
||
|
|
List<Object?> get props => [
|
||
|
|
operationId,
|
||
|
|
status,
|
||
|
|
error,
|
||
|
|
localFiles,
|
||
|
|
remoteFiles,
|
||
|
|
selectedFiles,
|
||
|
|
];
|
||
|
|
|
||
|
|
List<AttachmentModel> get allFiles => [...remoteFiles, ...localFiles];
|
||
|
|
|
||
|
|
OperationFilesState copyWith({
|
||
|
|
String? operationId,
|
||
|
|
OperationFilesStatus? status,
|
||
|
|
String? error,
|
||
|
|
List<AttachmentModel>? localFiles,
|
||
|
|
List<AttachmentModel>? remoteFiles,
|
||
|
|
List<AttachmentModel>? selectedFiles,
|
||
|
|
}) {
|
||
|
|
return OperationFilesState(
|
||
|
|
operationId: operationId ?? this.operationId,
|
||
|
|
status: status ?? this.status,
|
||
|
|
error: error,
|
||
|
|
localFiles: localFiles ?? this.localFiles,
|
||
|
|
remoteFiles: remoteFiles ?? this.remoteFiles,
|
||
|
|
selectedFiles: selectedFiles ?? this.selectedFiles,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|