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.

33 lines
814B

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