2026-04-09 11:30:57 +02:00
|
|
|
part of 'store_bloc.dart';
|
|
|
|
|
|
|
|
|
|
enum StoreStatus { initial, loading, success, failure }
|
|
|
|
|
|
|
|
|
|
class StoreState extends Equatable {
|
|
|
|
|
final StoreStatus status;
|
|
|
|
|
final StoreModel? store;
|
|
|
|
|
final String? errorMessage;
|
2026-04-13 15:18:37 +02:00
|
|
|
final List<StoreModel> stores;
|
2026-04-13 19:27:23 +02:00
|
|
|
final Map<StoreModel, List<StaffMemberModel>> staffByStore;
|
2026-04-09 11:30:57 +02:00
|
|
|
|
|
|
|
|
const StoreState({
|
|
|
|
|
this.status = StoreStatus.initial,
|
|
|
|
|
this.store,
|
|
|
|
|
this.errorMessage,
|
2026-04-13 15:18:37 +02:00
|
|
|
required this.stores,
|
2026-04-13 19:27:23 +02:00
|
|
|
required this.staffByStore,
|
2026-04-09 11:30:57 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
StoreState copyWith({
|
|
|
|
|
StoreStatus? status,
|
|
|
|
|
StoreModel? store,
|
|
|
|
|
String? errorMessage,
|
2026-04-13 15:18:37 +02:00
|
|
|
List<StoreModel>? stores,
|
2026-04-13 19:27:23 +02:00
|
|
|
Map<StoreModel, List<StaffMemberModel>>? staffByStore,
|
2026-04-09 11:30:57 +02:00
|
|
|
}) {
|
|
|
|
|
return StoreState(
|
|
|
|
|
status: status ?? this.status,
|
|
|
|
|
store: store ?? this.store,
|
|
|
|
|
errorMessage: errorMessage ?? this.errorMessage,
|
2026-04-13 15:18:37 +02:00
|
|
|
stores: stores ?? this.stores,
|
2026-04-13 19:27:23 +02:00
|
|
|
staffByStore: staffByStore ?? this.staffByStore,
|
2026-04-09 11:30:57 +02:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
2026-04-13 19:27:23 +02:00
|
|
|
List<Object?> get props => [
|
|
|
|
|
status,
|
|
|
|
|
store,
|
|
|
|
|
errorMessage,
|
|
|
|
|
stores,
|
|
|
|
|
staffByStore,
|
|
|
|
|
];
|
2026-04-09 11:30:57 +02:00
|
|
|
}
|