maremma maiala impestata, buonissima base dopo ultra refactor
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
46
lib/features/customers/blocs/customers_state.dart
Normal file
46
lib/features/customers/blocs/customers_state.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
part of 'customers_cubit.dart';
|
||||
|
||||
enum CustomersStatus {
|
||||
initial,
|
||||
loading,
|
||||
filesLoading,
|
||||
filesUploading,
|
||||
success,
|
||||
failure,
|
||||
}
|
||||
|
||||
class CustomersState extends Equatable {
|
||||
final CustomersStatus status;
|
||||
final List<CustomerModel> customers;
|
||||
final CustomerModel? lastCreatedCustomer;
|
||||
final String? errorMessage;
|
||||
|
||||
const CustomersState({
|
||||
this.status = CustomersStatus.initial,
|
||||
this.customers = const [],
|
||||
this.lastCreatedCustomer,
|
||||
this.errorMessage,
|
||||
});
|
||||
|
||||
CustomersState copyWith({
|
||||
CustomersStatus? status,
|
||||
List<CustomerModel>? customers,
|
||||
CustomerModel? lastCreatedCustomer,
|
||||
String? errorMessage,
|
||||
}) {
|
||||
return CustomersState(
|
||||
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,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user