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.

32 lines
824B

  1. part of 'infinity_scroll_bloc.dart';
  2. abstract class InfinityScrollState extends Equatable {
  3. const InfinityScrollState();
  4. @override
  5. List<Object> get props => [];
  6. }
  7. class InfinityScrollInitial extends InfinityScrollState {}
  8. class InfinityScrollFailure extends InfinityScrollState {}
  9. class InfinityScrollSuccess<T> extends InfinityScrollState {
  10. final List<T> items;
  11. final int page;
  12. final bool hasReachedMax;
  13. const InfinityScrollSuccess({this.items, this.page, this.hasReachedMax});
  14. InfinityScrollSuccess copyWith(
  15. {List<T> items, int page, bool hasReachedMax}) {
  16. return InfinityScrollSuccess(
  17. items: items ?? this.items,
  18. page: page ?? this.page,
  19. hasReachedMax: hasReachedMax ?? this.hasReachedMax);
  20. }
  21. @override
  22. List<Object> get props => [items, hasReachedMax];
  23. }