copyWith method

ArbMetadata copyWith({
  1. String? namespace,
  2. String? description,
  3. String? context,
  4. Map<String, ArbPlaceholder>? placeholders,
  5. bool? locked,
  6. bool? glossaryExempt,
  7. Object? sourceHash = _sentinel,
  8. Map<String, Object?>? extras,
})

Implementation

ArbMetadata copyWith({
  String? namespace,
  String? description,
  String? context,
  Map<String, ArbPlaceholder>? placeholders,
  bool? locked,
  bool? glossaryExempt,
  Object? sourceHash = _sentinel,
  Map<String, Object?>? extras,
}) {
  return ArbMetadata(
    namespace: namespace ?? this.namespace,
    description: description ?? this.description,
    context: context ?? this.context,
    placeholders: placeholders ?? this.placeholders,
    locked: locked ?? this.locked,
    glossaryExempt: glossaryExempt ?? this.glossaryExempt,
    // sourceHash uses an explicit sentinel so callers can pass `null`
    // to clear the field (unlock action) without colliding with the
    // "leave it alone" default.
    sourceHash: identical(sourceHash, _sentinel)
        ? this.sourceHash
        : sourceHash as String?,
    extras: extras ?? this.extras,
  );
}