You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
940B

  1. part of 'noti_bloc.dart';
  2. abstract class NotiState {
  3. const NotiState();
  4. @override
  5. List<Object> get props => [];
  6. }
  7. class NotiInitial extends NotiState {}
  8. class NotiLoadding extends NotiState {}
  9. class NotiFailure extends NotiState {
  10. final String errorString;
  11. NotiFailure({required this.errorString});
  12. }
  13. class NotiSuccess<T> extends NotiState {
  14. final int? unread;
  15. final int? read;
  16. final List<T>? items;
  17. final int? page;
  18. final bool? hasReachedMax;
  19. const NotiSuccess({this.unread, this.read, this.items, this.page, this.hasReachedMax});
  20. NotiSuccess copyWith({List<T>? items, int? page, bool? hasReachedMax}) {
  21. return NotiSuccess(
  22. unread: unread ?? this.unread,
  23. read: read ?? this.read,
  24. items: items ?? this.items,
  25. page: page ?? this.page,
  26. hasReachedMax: hasReachedMax ?? this.hasReachedMax);
  27. }
  28. // @override
  29. // List<Object> get props => [items, hasReachedMax];
  30. }