getLatestRevision method
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 {
try {
final response = await client.getLatestRevision(kref.uri);
return Revision(response, client);
} catch (e) {
// No revisions found
return null;
}
}