Files
flux/lib/features/store/bloc/store_state.dart
2026-04-13 19:27:23 +02:00

45 lines
1.0 KiB
Dart

part of 'store_bloc.dart';
enum StoreStatus { initial, loading, success, failure }
class StoreState extends Equatable {
final StoreStatus status;
final StoreModel? store;
final String? errorMessage;
final List<StoreModel> stores;
final Map<StoreModel, List<StaffMemberModel>> staffByStore;
const StoreState({
this.status = StoreStatus.initial,
this.store,
this.errorMessage,
required this.stores,
required this.staffByStore,
});
StoreState copyWith({
StoreStatus? status,
StoreModel? store,
String? errorMessage,
List<StoreModel>? stores,
Map<StoreModel, List<StaffMemberModel>>? staffByStore,
}) {
return StoreState(
status: status ?? this.status,
store: store ?? this.store,
errorMessage: errorMessage ?? this.errorMessage,
stores: stores ?? this.stores,
staffByStore: staffByStore ?? this.staffByStore,
);
}
@override
List<Object?> get props => [
status,
store,
errorMessage,
stores,
staffByStore,
];
}