import 'package:equatable/equatable.dart';
import 'package:first_project/domain/models/card.dart';
import 'package:first_project/domain/models/home.dart';
import 'package:first_project/presentation/home_page/home_page.dart';
import 'package:copy_with_extension/copy_with_extension.dart';

part 'state.g.dart';

@CopyWith()
class HomeState extends Equatable {
  final HomeData? data;
  final bool isLoading;
  final bool isPaginationLoading;
  final String? error;

  const HomeState({
    this.data,
    this.isLoading = false,
    this.isPaginationLoading = false,
    this.error,
  });

  HomeState copyWith({HomeData? data, bool? isLoading, bool? isPaginationLoading, String? error}) =>
      HomeState(
        data: data ?? this.data,
        isLoading: isLoading ?? this.isLoading,
        isPaginationLoading: isPaginationLoading ?? this.isPaginationLoading,
        error: error ?? this.error,
      );

  @override
  List<Object?> get props => [
        data,
        isLoading,
        isPaginationLoading,
        error,
      ];
}
