toJson method

  1. @override
Map<String, Object> toJson({
  1. ClientUriConverter? clientUriConverter,
})

Returns a JSON presentation of the object.

Implementation

@override
Map<String, Object> toJson({ClientUriConverter? clientUriConverter}) {
  var result = <String, Object>{};
  result['file'] = clientUriConverter?.toClientFilePath(file) ?? file;
  result['regions'] =
      regions
          .map(
            (NavigationRegion value) =>
                value.toJson(clientUriConverter: clientUriConverter),
          )
          .toList();
  result['targets'] =
      targets
          .map(
            (NavigationTarget value) =>
                value.toJson(clientUriConverter: clientUriConverter),
          )
          .toList();
  result['files'] =
      files
          .map(
            (String value) =>
                clientUriConverter?.toClientFilePath(value) ?? value,
          )
          .toList();
  return result;
}