part of 'noti_bloc.dart';

abstract class NotiState {
  const NotiState();

  @override
  List<Object> get props => [];
}

class NotiInitial extends NotiState {}

class NotiLoadding extends NotiState {}

class NotiFailure extends NotiState {
  final String errorString;
  NotiFailure({required this.errorString});
}

class NotiSuccess<T> extends NotiState {
  final int? unread;
  final int? read;
  final List<T> items;
  final int page;
  final bool hasReachedMax;

  const NotiSuccess({this.unread, this.read, required this.items, required this.page, required this.hasReachedMax});

  NotiSuccess copyWith({List<T>? items, int? page, bool? hasReachedMax}) {
    return NotiSuccess(
        unread: unread ?? unread,
        read: read ?? read,
        items: items ?? this.items,
        page: page ?? this.page,
        hasReachedMax: hasReachedMax ?? this.hasReachedMax);
  }

  @override
  List<Object> get props => [items, hasReachedMax];
}
