withJwtFile static method

Future<GoogleVision> withJwtFile(
  1. String credentialsFile,
  2. [String scope = 'https://www.googleapis.com/auth/cloud-platform']
)

Authenticated with JWT.

Implementation

static Future<GoogleVision> withJwtFile(String credentialsFile,
    [String scope = 'https://www.googleapis.com/auth/cloud-platform']) async {
  GoogleVision yt = GoogleVision();

  tokenGenerator = JwtGenerator.fromFile(
      credentialsFile: credentialsFile, scope: scope, dio: dio);

  await _confirmToken();

  return yt;
}