31 lines
766 B
Dart
31 lines
766 B
Dart
part of 'operation_form_cubit.dart';
|
|
|
|
enum OperationFormStatus { initial, loading, ready, saving, success, failure }
|
|
|
|
class OperationFormState extends Equatable {
|
|
final OperationFormStatus status;
|
|
final OperationModel operation;
|
|
final String? errorMessage;
|
|
|
|
const OperationFormState({
|
|
this.status = OperationFormStatus.initial,
|
|
required this.operation,
|
|
this.errorMessage,
|
|
});
|
|
|
|
OperationFormState copyWith({
|
|
OperationFormStatus? status,
|
|
OperationModel? operation,
|
|
String? errorMessage,
|
|
}) {
|
|
return OperationFormState(
|
|
status: status ?? this.status,
|
|
operation: operation ?? this.operation,
|
|
errorMessage: errorMessage,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [status, operation, errorMessage];
|
|
}
|