GSheets.withServiceAccountCredentials constructor

GSheets.withServiceAccountCredentials(
  1. ServiceAccountCredentials credentials, {
  2. String? impersonatedUser,
  3. List<String> scopes = const [SheetsApi.spreadsheetsScope, SheetsApi.driveScope],
})

Creates an instance of GSheets.

credentials - must be provided, credentials for a service account.

scopes - optional (defaults to [SpreadsheetsScope, DriveScope]).

Implementation

GSheets.withServiceAccountCredentials(
  ServiceAccountCredentials credentials, {
  String? impersonatedUser,
  List<String> scopes = const [
    SheetsApi.spreadsheetsScope,
    SheetsApi.driveScope,
  ],
})  : _externalClient = null,
      _credentials = credentials,
      _clientId = null,
      _scopes = null;