Files
flux/lib/features/store/bloc/store_state.dart

45 lines
1.0 KiB
Dart
Raw Normal View History

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;
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,
});
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,
}) {
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,
);
}
@override
2026-04-13 19:27:23 +02:00
List<Object?> get props => [
status,
store,
errorMessage,
stores,
staffByStore,
];
}