copyWith method

DatumConflictResolution<T> copyWith({
  1. DatumResolutionStrategy? strategy,
  2. T? resolvedData,
  3. bool? requiresUserInput,
  4. String? message,
  5. bool setResolvedDataToNull = false,
})

Creates a copy of this resolution with updated fields.

Implementation

DatumConflictResolution<T> copyWith({
  DatumResolutionStrategy? strategy,
  T? resolvedData,
  bool? requiresUserInput,
  String? message,
  bool setResolvedDataToNull = false,
}) {
  return DatumConflictResolution<T>._(
    strategy: strategy ?? this.strategy,
    // If setResolvedDataToNull is true, set it to null, otherwise use the
    // provided value or the existing one.
    resolvedData: setResolvedDataToNull ? null : (resolvedData ?? this.resolvedData),
    requiresUserInput: requiresUserInput ?? this.requiresUserInput,
    message: message ?? this.message,
  );
}