tagsByFilter method
- Filter? filter
Returns a list of tags based on a filter.
If no filter is provided, all tags will be returned.
_viam = await Viam.withApiKey(
dotenv.env['API_KEY_ID'] ?? '',
dotenv.env['API_KEY'] ?? ''
);
final dataClient = _viam.dataClient;
try {
// Create a filter to target specific binary data
final filter = Filter(
componentName: "camera-1",
);
// Call the function to get tags by filter
final tags = await dataClient.tagsByFilter(filter);
print('Successfully got tags: $tags');
} catch (e) {
print('Error getting tags: $e');
}
For more information, see Data Client API.
Implementation
Future<List<String>> tagsByFilter(Filter? filter) async {
final request = TagsByFilterRequest()..filter = filter ?? Filter();
final response = await _dataClient.tagsByFilter(request);
return response.tags;
}