copyWith method
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,
);
}