|
- part of 'infinity_scroll_bloc.dart';
-
- abstract class InfinityScrollState extends Equatable {
- const InfinityScrollState();
-
- @override
- List<Object> get props => [];
- }
-
- class InfinityScrollInitial extends InfinityScrollState {}
-
- class InfinityScrollFailure extends InfinityScrollState {}
-
- class InfinityScrollSuccess<T> extends InfinityScrollState {
- final List<T> items;
- final int page;
- final bool hasReachedMax;
-
- const InfinityScrollSuccess({this.items, this.page, this.hasReachedMax});
-
- InfinityScrollSuccess copyWith(
- {List<T> items, int page, bool hasReachedMax}) {
- return InfinityScrollSuccess(
- items: items ?? this.items,
- page: page ?? this.page,
- hasReachedMax: hasReachedMax ?? this.hasReachedMax);
- }
-
- @override
- List<Object> get props => [items, hasReachedMax];
- }
|