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
770B

  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 PlotFailure extends PlotState {
  9. final String errorString;
  10. PlotFailure({@required this.errorString});
  11. }
  12. class PlotSuccess<T> extends PlotState {
  13. final List<T> items;
  14. final int page;
  15. final bool hasReachedMax;
  16. const PlotSuccess({this.items, this.page, this.hasReachedMax});
  17. PlotSuccess copyWith({List<T> items, int page, bool hasReachedMax}) {
  18. return PlotSuccess(
  19. items: items ?? this.items,
  20. page: page ?? this.page,
  21. hasReachedMax: hasReachedMax ?? this.hasReachedMax);
  22. }
  23. @override
  24. List<Object> get props => [items, hasReachedMax];
  25. }