Files
flux/lib/features/master_data/staff/blocs/staff_state.dart

43 lines
1.0 KiB
Dart

part of 'staff_cubit.dart';
class StaffState extends Equatable {
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.allStaff = const [],
this.storesByStaff = const {},
this.staffByStore = const {},
this.isLoading = false,
this.error,
});
StaffState copyWith({
List<StaffMemberModel>? allStaff,
Map<String, List<StoreModel>>? storesByStaff,
Map<String, List<StaffMemberModel>>? staffByStore,
bool? isLoading,
String? error,
}) {
return StaffState(
allStaff: allStaff ?? this.allStaff,
storesByStaff: storesByStaff ?? this.storesByStaff,
staffByStore: staffByStore ?? this.staffByStore,
isLoading: isLoading ?? this.isLoading,
error: error,
);
}
@override
List<Object?> get props => [
allStaff,
storesByStaff,
staffByStore,
isLoading,
error,
];
}