getLatestRevision method

Future<Revision?> getLatestRevision()

Gets the latest revision of this item.

Returns null if no revisions exist. The helper swallows the "not found" response from the control plane and surfaces a nullable Revision wrapper instead of throwing.

final latest = await item.getLatestRevision();
if (latest != null) {
  print('Latest: v${latest.number}');
}

Implementation

Future<Revision?> getLatestRevision() async {
  final response = await client.getLatestRevision(kref.uri);
  if (response == null) {
    // No revisions found
    return null;
  }
  return Revision(response, client);
}