2024-11-11 16:25:25 +04:00
|
|
|
import 'package:equatable/equatable.dart';
|
2024-12-21 14:35:19 +04:00
|
|
|
import 'package:pmu_labs/domain/models/card_data.dart';
|
|
|
|
import 'package:pmu_labs/domain/models/home_data.dart';
|
2024-11-11 16:25:25 +04:00
|
|
|
|
2024-11-11 18:13:49 +04:00
|
|
|
class HomeState extends Equatable {
|
2024-12-21 14:35:19 +04:00
|
|
|
final HomeData? data;
|
2024-11-11 18:13:49 +04:00
|
|
|
final bool isLoading;
|
|
|
|
final String? error;
|
2024-11-11 16:25:25 +04:00
|
|
|
|
2024-11-11 18:13:49 +04:00
|
|
|
const HomeState({
|
|
|
|
this.data,
|
|
|
|
this.isLoading = false,
|
|
|
|
this.error,
|
|
|
|
});
|
2024-11-11 16:25:25 +04:00
|
|
|
|
2024-11-11 18:13:49 +04:00
|
|
|
HomeState copyWith({
|
2024-12-21 14:35:19 +04:00
|
|
|
HomeData? data,
|
2024-11-11 18:13:49 +04:00
|
|
|
bool? isLoading,
|
|
|
|
String? error,
|
|
|
|
}) =>
|
|
|
|
HomeState(
|
|
|
|
data: data ?? this.data,
|
|
|
|
isLoading: isLoading ?? this.isLoading,
|
|
|
|
error: error ?? this.error,
|
|
|
|
);
|
2024-11-11 16:25:25 +04:00
|
|
|
|
|
|
|
@override
|
2024-11-11 18:13:49 +04:00
|
|
|
List<Object?> get props => [
|
|
|
|
data,
|
|
|
|
isLoading,
|
|
|
|
error,
|
|
|
|
];
|
|
|
|
}
|