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.

34 lines
949B

  1. part of 'plot_detail_bloc.dart';
  2. abstract class PlotDetailState {
  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({this.ownerItem, required this.items, required this.page, required this.hasReachedMax});
  19. PlotDetailSuccess copyWith({required List<T> items, required int page, required bool hasReachedMax}) {
  20. return PlotDetailSuccess(items: items ?? this.items, page: page ?? this.page, hasReachedMax: hasReachedMax ?? this.hasReachedMax);
  21. }
  22. @override
  23. List<Object> get props => [items, hasReachedMax];
  24. }