staff
This commit is contained in:
33
lib/features/staff/blocs/staff_state.dart
Normal file
33
lib/features/staff/blocs/staff_state.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
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];
|
||||
}
|
||||
Reference in New Issue
Block a user