2026-04-20 16:52:20 +02:00
|
|
|
part of 'customer_cubit.dart';
|
2026-04-10 10:47:56 +02:00
|
|
|
|
2026-04-26 10:15:34 +02:00
|
|
|
enum CustomerStatus {
|
|
|
|
|
initial,
|
|
|
|
|
loading,
|
|
|
|
|
filesLoading,
|
|
|
|
|
filesUploading,
|
|
|
|
|
success,
|
|
|
|
|
failure,
|
|
|
|
|
}
|
2026-04-10 10:47:56 +02:00
|
|
|
|
|
|
|
|
class CustomerState extends Equatable {
|
|
|
|
|
final CustomerStatus status;
|
2026-04-20 16:52:20 +02:00
|
|
|
final List<CustomerModel> customers;
|
|
|
|
|
final CustomerModel? lastCreatedCustomer;
|
2026-04-10 10:47:56 +02:00
|
|
|
final String? errorMessage;
|
|
|
|
|
|
|
|
|
|
const CustomerState({
|
|
|
|
|
this.status = CustomerStatus.initial,
|
|
|
|
|
this.customers = const [],
|
|
|
|
|
this.lastCreatedCustomer,
|
|
|
|
|
this.errorMessage,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
CustomerState copyWith({
|
|
|
|
|
CustomerStatus? status,
|
|
|
|
|
List<CustomerModel>? customers,
|
|
|
|
|
CustomerModel? lastCreatedCustomer,
|
|
|
|
|
String? errorMessage,
|
|
|
|
|
}) {
|
|
|
|
|
return CustomerState(
|
|
|
|
|
status: status ?? this.status,
|
|
|
|
|
customers: customers ?? this.customers,
|
|
|
|
|
lastCreatedCustomer: lastCreatedCustomer ?? this.lastCreatedCustomer,
|
|
|
|
|
errorMessage: errorMessage ?? this.errorMessage,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
List<Object?> get props => [
|
|
|
|
|
status,
|
|
|
|
|
customers,
|
|
|
|
|
lastCreatedCustomer,
|
|
|
|
|
errorMessage,
|
|
|
|
|
];
|
|
|
|
|
}
|