Sense.fromRemoteSense constructor Null safety

Sense.fromRemoteSense(
  1. SenseFromRemote remoteSense
)

Implementation

Sense.fromRemoteSense(remote.SenseFromRemote remoteSense)
    : definitions =
          remoteSense.definitions ?? remoteSense.crossReferenceMarkers ?? [],
      crossReferences = remoteSense.crossReferences ?? [],
      subSenses = remoteSense.subSenses
              ?.map((e) => Sense.fromRemoteSense(e))
              .toList() ??
          [],
      constructions =
          remoteSense.constructions?.map((e) => e.text).toList() ?? [],
      synonyms = remoteSense.synonyms?.map((e) => e.text).toList() ?? [],
      isCrossReferenced = remoteSense.crossReferenceMarkers != null &&
          remoteSense.definitions == null,
      shortDefinitions = remoteSense.shortDefinitions ?? [],
      examples = remoteSense.examples
              ?.map((e) => e.text)
              .whereType<String>()
              .toList() ??
          [],
      semanticClasses =
          remoteSense.semanticClasses?.map((e) => e.text).toList() ?? [],
      domains = remoteSense.domainClasses
              ?.map((e) => e.text)
              .whereType<String>()
              .toList() ??
          [];