copyWith method

ABUSResult copyWith({
  1. bool? isSuccess,
  2. Map<String, dynamic>? data,
  3. Object? payload,
  4. String? error,
  5. DateTime? timestamp,
  6. String? interactionId,
  7. Map<String, dynamic>? metadata,
})

Creates a copy of this result with updated values.

Useful for transforming results while preserving most properties.

Example:

final newResult = result.copyWith(
  payload: transformedUser,
  metadata: {'transformed': true},
);

Parameters: All parameters are optional and default to current values Returns a new ABUSResult with updated values

Implementation

ABUSResult copyWith({
  bool? isSuccess,
  Map<String, dynamic>? data,
  Object? payload,
  String? error,
  DateTime? timestamp,
  String? interactionId,
  Map<String, dynamic>? metadata,
}) {
  return ABUSResult._(
    isSuccess: isSuccess ?? this.isSuccess,
    data: data ?? this.data,
    payload: payload ?? this.payload,
    error: error ?? this.error,
    timestamp: timestamp ?? this.timestamp,
    interactionId: interactionId ?? this.interactionId,
    metadata: metadata ?? this.metadata,
  );
}