urca non ci credo, potrebbe già funzionare

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-26 16:29:31 +02:00
parent 1d3a685368
commit 6cbf0479a1
9 changed files with 297 additions and 101 deletions

View File

@@ -1,42 +1,44 @@
part of 'staff_cubit.dart';
enum StaffStatus { initial, loading, success, error }
class StaffState extends Equatable {
final StaffStatus status;
final List<StaffMemberModel> allStaff;
final Map<String, List<StoreModel>> storesByStaff;
final Map<String, List<StaffMemberModel>> staffByStore;
final bool isLoading;
final String? error;
const StaffState({
this.status = StaffStatus.initial,
this.allStaff = const [],
this.storesByStaff = const {},
this.staffByStore = const {},
this.isLoading = false,
this.error,
});
StaffState copyWith({
StaffStatus? status,
List<StaffMemberModel>? allStaff,
Map<String, List<StoreModel>>? storesByStaff,
Map<String, List<StaffMemberModel>>? staffByStore,
bool? isLoading,
String? error,
}) {
return StaffState(
status: status ?? this.status,
allStaff: allStaff ?? this.allStaff,
storesByStaff: storesByStaff ?? this.storesByStaff,
staffByStore: staffByStore ?? this.staffByStore,
isLoading: isLoading ?? this.isLoading,
error: error,
);
}
@override
List<Object?> get props => [
status,
allStaff,
storesByStaff,
staffByStore,
isLoading,
error,
];
}