getMetadataValue method

Future<String?> getMetadataValue(
  1. String key
)

Gets a metadata value by key.

Returns null only when the attribute is not set. An attribute that exists with an empty-string value returns '', not null.

final format = await artifact.getMetadataValue('format');

Implementation

Future<String?> getMetadataValue(String key) async {
  final response = await client.getAttribute(kref.uri, key);
  return response.exists ? response.value : null;
}