reworked operation (#12)
Reviewed-on: #12 Co-authored-by: Mark M2 Macbook <marco@catelli.it> Co-committed-by: Mark M2 Macbook <marco@catelli.it>
This commit is contained in:
81
lib/features/operations/blocs/operation_files_events.dart
Normal file
81
lib/features/operations/blocs/operation_files_events.dart
Normal file
@@ -0,0 +1,81 @@
|
||||
part of 'operation_files_bloc.dart';
|
||||
|
||||
abstract class OperationFilesEvent extends Equatable {
|
||||
const OperationFilesEvent();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class OperationsavedEvent extends OperationFilesEvent {
|
||||
final String operationId;
|
||||
const OperationsavedEvent(this.operationId);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [operationId];
|
||||
}
|
||||
|
||||
class LoadOperationFilesEvent extends OperationFilesEvent {
|
||||
final String? operationId;
|
||||
final AttachmentModel? operation;
|
||||
const LoadOperationFilesEvent({this.operationId, this.operation});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [operationId, operation];
|
||||
}
|
||||
|
||||
class AddOperationFilesEvent extends OperationFilesEvent {
|
||||
final List<PlatformFile> files;
|
||||
const AddOperationFilesEvent(this.files);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [files];
|
||||
}
|
||||
|
||||
class UploadOperationFilesEvent extends OperationFilesEvent {
|
||||
final List<PlatformFile>? pickedFiles;
|
||||
final List<XFile>? photos;
|
||||
const UploadOperationFilesEvent({this.pickedFiles, this.photos});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [pickedFiles, photos];
|
||||
}
|
||||
|
||||
class LinkFilesToCustomerEvent extends OperationFilesEvent {
|
||||
final String customerId;
|
||||
|
||||
const LinkFilesToCustomerEvent({required this.customerId});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [customerId];
|
||||
}
|
||||
|
||||
class DeleteOperationFilesEvent extends OperationFilesEvent {}
|
||||
|
||||
class ToggleOperationFileSelectionEvent extends OperationFilesEvent {
|
||||
final AttachmentModel file;
|
||||
const ToggleOperationFileSelectionEvent(this.file);
|
||||
}
|
||||
|
||||
class RenameOperationFileEvent extends OperationFilesEvent {
|
||||
final AttachmentModel file;
|
||||
final String newName;
|
||||
|
||||
const RenameOperationFileEvent(this.file, this.newName);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [file, newName];
|
||||
}
|
||||
|
||||
class DeleteSpecificOperationFileEvent extends OperationFilesEvent {
|
||||
final AttachmentModel file;
|
||||
|
||||
const DeleteSpecificOperationFileEvent(this.file);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [file];
|
||||
}
|
||||
|
||||
class SelectAllOperationFilesEvent extends OperationFilesEvent {}
|
||||
|
||||
class ClearOperationFileSelectionEvent extends OperationFilesEvent {}
|
||||
Reference in New Issue
Block a user