positionsFromManifest method

Future<List<Locator>> positionsFromManifest()

Implementation

Future<List<Locator>> positionsFromManifest() async {
  ResourceTry<String?>? resourceString = await links
      .firstWithMediaType(_positionsLink.mediaType)
      ?.let((it) => get(it))
      .readAsString();
  return resourceString
          ?.getOrNull()
          ?.toJsonOrNull()
          ?.optJSONArray("positions")
          ?.mapNotNull((it) => Locator.fromJson(it as Map<String, dynamic>))
          .toList() ??
      [];
}