part of 'operations_cubit.dart'; enum OperationsStatus { initial, loading, ready, saving, saved, savedNoPop, success, failure, } class OperationsState extends Equatable { final OperationsStatus status; final List allOperations; final OperationModel? currentOperation; // La bozza che stiamo editando final String? errorMessage; final String query; final DateTimeRange? dateRange; final bool hasReachedMax; final bool isSavingDraft; const OperationsState({ required this.status, this.allOperations = const [], this.currentOperation, this.errorMessage, this.query = '', this.dateRange, this.hasReachedMax = false, this.isSavingDraft = false, }); OperationsState copyWith({ OperationsStatus? status, List? allOperations, OperationModel? currentOperation, String? errorMessage, String? query, DateTimeRange? dateRange, bool? hasReachedMax, bool? isSavingDraft, }) { return OperationsState( status: status ?? this.status, allOperations: allOperations ?? this.allOperations, currentOperation: currentOperation ?? this.currentOperation, errorMessage: errorMessage, query: query ?? this.query, dateRange: dateRange ?? this.dateRange, hasReachedMax: hasReachedMax ?? this.hasReachedMax, isSavingDraft: isSavingDraft ?? this.isSavingDraft, ); } @override List get props => [ status, allOperations, currentOperation, errorMessage, query, dateRange, hasReachedMax, isSavingDraft, ]; }