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.

38 lines
945B

  1. part of 'plot_detail_bloc.dart';
  2. abstract class PlotDetailState extends Equatable {
  3. const PlotDetailState();
  4. @override
  5. List<Object> get props => [];
  6. }
  7. class PlotDetailInitial extends PlotDetailState {}
  8. class PlotDetailLoading extends PlotDetailState {}
  9. class PlotDetailFailure extends PlotDetailState {
  10. final String errorString;
  11. PlotDetailFailure({@required this.errorString});
  12. }
  13. class PlotDetailSuccess<T> extends PlotDetailState {
  14. final T ownerItem;
  15. final List<T> items;
  16. final int page;
  17. final bool hasReachedMax;
  18. const PlotDetailSuccess(
  19. {this.ownerItem, this.items, this.page, this.hasReachedMax});
  20. PlotDetailSuccess copyWith({List<T> items, int page, bool hasReachedMax}) {
  21. return PlotDetailSuccess(
  22. items: items ?? this.items,
  23. page: page ?? this.page,
  24. hasReachedMax: hasReachedMax ?? this.hasReachedMax);
  25. }
  26. @override
  27. List<Object> get props => [items, hasReachedMax];
  28. }