part of 'task_bloc.dart';

abstract class TaskState extends Equatable {
  const TaskState();

  @override
  List<Object> get props => [];
}

class TaskInitial extends TaskState {}

class TaskLoading extends TaskState {}

class TaskFailure extends TaskState {
  final String errorString;
  TaskFailure({required this.errorString});
}

class TaskSuccess<Task> extends TaskState {
  final List<Task>? items;
  final int? page;
  final bool? hasReachedMax;

  const TaskSuccess({this.items, this.page, this.hasReachedMax});

  TaskSuccess copyWith({List<Task>? items, int? page, bool? hasReachedMax}) {
    return TaskSuccess(
      items: items ?? this.items,
      page: page ?? this.page,
      hasReachedMax: hasReachedMax ?? this.hasReachedMax,
    );
  }
}
