Skip to content

Instantly share code, notes, and snippets.

@AlexKorovyansky
Created January 12, 2020 18:15
Show Gist options
  • Save AlexKorovyansky/c1e4d0c8fa7af8116ad5edd3c2e17856 to your computer and use it in GitHub Desktop.
Save AlexKorovyansky/c1e4d0c8fa7af8116ad5edd3c2e17856 to your computer and use it in GitHub Desktop.
Append to Spreadsheet
final _credentials = new ServiceAccountCredentials.fromJson(r'''
{
"private_key_id": "***",
"private_key": "***",
"client_email": "***",
"client_id": "***",
"type": "***"
}
''');
const _SCOPES = const [SheetsApi.SpreadsheetsScope];
clientViaServiceAccount(_credentials, _SCOPES).then((httpClient) {
var sheetsApi = new SheetsApi(httpClient);
sheetsApi.spreadsheets.values.append(
ValueRange.fromJson({"values": [["QR", "Авангард", "цвет формы", "#игрока", "фамилия игрока"]]}),
"<spreadsheet_id",
"A1:Z998",
valueInputOption: "USER_ENTERED").then((response){
print('it works!');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment