part of 'solidarity_bloc.dart';

enum SolidarityStatus { initial, loading, loaded, error }

class SolidarityState extends Equatable {
  final SolidarityStatus status;
  final List<DemandeAideModel> demandes;
  final DemandeAideModel? demandeDetail;
  final String? message;
  final Object? error;

  const SolidarityState({
    this.status = SolidarityStatus.initial,
    this.demandes = const [],
    this.demandeDetail,
    this.message,
    this.error,
  });

  SolidarityState copyWith({
    SolidarityStatus? status,
    List<DemandeAideModel>? demandes,
    DemandeAideModel? demandeDetail,
    String? message,
    Object? error,
  }) {
    return SolidarityState(
      status: status ?? this.status,
      demandes: demandes ?? this.demandes,
      demandeDetail: demandeDetail ?? this.demandeDetail,
      message: message ?? this.message,
      error: error ?? this.error,
    );
  }

  @override
  List<Object?> get props => [status, demandes, demandeDetail, message, error];
}
