pmu_flutter/lec6/lib/view/home_page/bloc/state.dart

34 lines
641 B
Dart
Raw Permalink Normal View History

2024-10-18 01:15:10 +04:00
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,
];
}