34 lines
829 B
Dart
34 lines
829 B
Dart
part of 'staff_cubit.dart';
|
|
|
|
class StaffState extends Equatable {
|
|
final List<StaffMemberModel> allStaff;
|
|
final Map<String, List<StaffMemberModel>>
|
|
staffByStore; // storeId -> List of staff
|
|
final bool isLoading;
|
|
final String? error;
|
|
|
|
const StaffState({
|
|
this.allStaff = const [],
|
|
this.staffByStore = const {},
|
|
this.isLoading = false,
|
|
this.error,
|
|
});
|
|
|
|
StaffState copyWith({
|
|
List<StaffMemberModel>? allStaff,
|
|
Map<String, List<StaffMemberModel>>? staffByStore,
|
|
bool? isLoading,
|
|
String? error,
|
|
}) {
|
|
return StaffState(
|
|
allStaff: allStaff ?? this.allStaff,
|
|
staffByStore: staffByStore ?? this.staffByStore,
|
|
isLoading: isLoading ?? this.isLoading,
|
|
error: error,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [allStaff, staffByStore, isLoading, error];
|
|
}
|