copyWith method

Locator copyWith({
  1. String? href,
  2. String? type,
  3. String? title,
  4. Locations? locations,
  5. LocatorText? text,
  6. Map<String, dynamic>? additionalProperties,
})

Implementation

Locator copyWith({
  String? href,
  String? type,
  String? title,
  Locations? locations,
  LocatorText? text,
  Map<String, dynamic>? additionalProperties,
}) {
  final mergeProperties = Map<String, dynamic>.of(this.additionalProperties)
    ..addAll(additionalProperties ?? {})
    ..removeWhere((key, value) => value == null);

  return Locator(
    href: href ?? this.href,
    type: type ?? this.type,
    title: title ?? this.title,
    locations: locations ?? this.locations,
    text: text ?? this.text,
    additionalProperties: mergeProperties,
  );
}