urca non ci credo, potrebbe già funzionare
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -1,42 +1,44 @@
|
||||
part of 'staff_cubit.dart';
|
||||
|
||||
enum StaffStatus { initial, loading, success, error }
|
||||
|
||||
class StaffState extends Equatable {
|
||||
final StaffStatus status;
|
||||
final List<StaffMemberModel> allStaff;
|
||||
final Map<String, List<StoreModel>> storesByStaff;
|
||||
final Map<String, List<StaffMemberModel>> staffByStore;
|
||||
final bool isLoading;
|
||||
final String? error;
|
||||
|
||||
const StaffState({
|
||||
this.status = StaffStatus.initial,
|
||||
this.allStaff = const [],
|
||||
this.storesByStaff = const {},
|
||||
this.staffByStore = const {},
|
||||
this.isLoading = false,
|
||||
this.error,
|
||||
});
|
||||
|
||||
StaffState copyWith({
|
||||
StaffStatus? status,
|
||||
List<StaffMemberModel>? allStaff,
|
||||
Map<String, List<StoreModel>>? storesByStaff,
|
||||
Map<String, List<StaffMemberModel>>? staffByStore,
|
||||
bool? isLoading,
|
||||
String? error,
|
||||
}) {
|
||||
return StaffState(
|
||||
status: status ?? this.status,
|
||||
allStaff: allStaff ?? this.allStaff,
|
||||
storesByStaff: storesByStaff ?? this.storesByStaff,
|
||||
staffByStore: staffByStore ?? this.staffByStore,
|
||||
isLoading: isLoading ?? this.isLoading,
|
||||
error: error,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
status,
|
||||
allStaff,
|
||||
storesByStaff,
|
||||
staffByStore,
|
||||
isLoading,
|
||||
error,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user