part of 'range_of_aqi_bloc.dart';

enum RangeOfAqiStatus { initial, loading, loaded, failure }

final class RangeOfAqiState extends Equatable {
  const RangeOfAqiState({
    this.rangeOfAqi = const [],
    this.filteredRangeOfAqi = const [],
    this.status = RangeOfAqiStatus.initial,
    this.errorMessage,
    this.selectedAqiType = AqiType.aqi,
  });

  final RangeOfAqiStatus status;
  final List<RangeOfAqi> rangeOfAqi;
  final List<RangeOfAqi> filteredRangeOfAqi;
  final String? errorMessage;
  final AqiType selectedAqiType;

  RangeOfAqiState copyWith({
    RangeOfAqiStatus? status,
    List<RangeOfAqi>? rangeOfAqi,
    List<RangeOfAqi>? filteredRangeOfAqi,
    String? errorMessage,
    AqiType? selectedAqiType,
  }) {
    return RangeOfAqiState(
      status: status ?? this.status,
      rangeOfAqi: rangeOfAqi ?? this.rangeOfAqi,
      filteredRangeOfAqi: filteredRangeOfAqi ?? this.filteredRangeOfAqi,
      errorMessage: errorMessage ?? this.errorMessage,
      selectedAqiType: selectedAqiType ?? this.selectedAqiType,
    );
  }

  @override
  List<Object?> get props =>
      [status, rangeOfAqi, filteredRangeOfAqi, errorMessage, selectedAqiType];
}
