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

50 lines
1.3 KiB
Dart
Raw Normal View History

part of 'staff_cubit.dart';
enum StaffStatus { initial, loading, success, emailSent, 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 List<StaffMemberModel> storeStaff;
final String? error;
const StaffState({
this.status = StaffStatus.initial,
this.allStaff = const [],
this.storesByStaff = const {},
this.staffByStore = const {},
this.storeStaff = const [],
this.error,
});
StaffState copyWith({
StaffStatus? status,
List<StaffMemberModel>? allStaff,
Map<String, List<StoreModel>>? storesByStaff,
Map<String, List<StaffMemberModel>>? staffByStore,
List<StaffMemberModel>? storeStaff,
String? error,
}) {
return StaffState(
status: status ?? this.status,
allStaff: allStaff ?? this.allStaff,
storesByStaff: storesByStaff ?? this.storesByStaff,
staffByStore: staffByStore ?? this.staffByStore,
storeStaff: storeStaff ?? this.storeStaff,
error: error,
);
}
@override
List<Object?> get props => [
status,
allStaff,
storesByStaff,
staffByStore,
storeStaff,
error,
];
}