getLatestRevision method

Future<RevisionResponse?> getLatestRevision(
  1. String itemKref
)
inherited

Gets the latest revision for an item, or null if none exist.

Mirrors Python's get_latest_revision: resolves the item kref via the ResolveKref RPC and returns null when the control plane reports the item has no revisions (NOT_FOUND).

Implementation

Future<RevisionResponse?> getLatestRevision(String itemKref) async {
  try {
    return await resolveKref(itemKref);
  } on GrpcError catch (e) {
    if (e.code == StatusCode.notFound) {
      return null;
    }
    rethrow;
  }
}