Files
flux/lib/features/operations/blocs/operation_list_state.dart

50 lines
1.2 KiB
Dart
Raw Normal View History

2026-05-08 12:28:14 +02:00
part of 'operation_list_cubit.dart';
enum OperationListStatus { initial, loading, success, failure }
class OperationListState extends Equatable {
final OperationListStatus status;
final List<OperationModel> operations;
final bool hasReachedMax;
final String? errorMessage;
final String query;
final DateTimeRange? dateRange;
const OperationListState({
this.status = OperationListStatus.initial,
this.operations = const [],
this.hasReachedMax = false,
this.errorMessage,
this.query = '',
this.dateRange,
});
OperationListState copyWith({
OperationListStatus? status,
List<OperationModel>? operations,
bool? hasReachedMax,
String? errorMessage,
String? query,
DateTimeRange? dateRange,
}) {
return OperationListState(
status: status ?? this.status,
operations: operations ?? this.operations,
hasReachedMax: hasReachedMax ?? this.hasReachedMax,
errorMessage: errorMessage,
query: query ?? this.query,
dateRange: dateRange ?? this.dateRange,
);
}
@override
List<Object?> get props => [
status,
operations,
hasReachedMax,
errorMessage,
query,
dateRange,
];
}