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.

41 lines
952B

  1. part of 'noti_bloc.dart';
  2. abstract class NotiState extends Equatable {
  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(
  20. {this.unread, this.read, this.items, this.page, this.hasReachedMax});
  21. NotiSuccess copyWith({List<T> items, int page, bool hasReachedMax}) {
  22. return NotiSuccess(
  23. unread: unread ?? this.unread,
  24. read: read ?? this.read,
  25. items: items ?? this.items,
  26. page: page ?? this.page,
  27. hasReachedMax: hasReachedMax ?? this.hasReachedMax);
  28. }
  29. @override
  30. List<Object> get props => [items, hasReachedMax];
  31. }