34 lines
641 B
Dart
34 lines
641 B
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:test_app/domain/home.dart';
|
|
|
|
class HomeState extends Equatable {
|
|
final HomeData? data;
|
|
final bool isLoading;
|
|
final String? error;
|
|
|
|
const HomeState({
|
|
this.data,
|
|
this.isLoading = false,
|
|
this.error,
|
|
});
|
|
|
|
HomeState copyWith({
|
|
HomeData? data,
|
|
bool? isLoading,
|
|
int? currentPage,
|
|
String? error,
|
|
}) =>
|
|
HomeState(
|
|
data: data ?? this.data,
|
|
isLoading: isLoading ?? this.isLoading,
|
|
error: error ?? this.error,
|
|
);
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
data,
|
|
isLoading,
|
|
error,
|
|
];
|
|
}
|