run method Null safety
override
Runs this command.
The return value is wrapped in a Future
if necessary and returned by
CommandRunner.runCommand
.
Implementation
@override
void run() async {
final googleVision = await GoogleVision.withJwt(
globalResults!['credential-file'],
'https://www.googleapis.com/auth/cloud-vision');
final image = Image.fromFilePath(argResults!['image-file']);
final requests = AnnotationRequests(requests: [
AnnotationRequest(
image: image,
features: [Feature(type: 'SAFE_SEARCH_DETECTION')],
)
]);
final annotatedResponses = await googleVision.annotate(requests: requests);
print(annotatedResponses.responses);
}