googleapis_client 0.0.1 googleapis_client: ^0.0.1 copied to clipboard
A library googleapis_client for interact with google apis more easy.
Googleapis Client #
Library ini di buat agar mempermudah kalian menggunakan googleapis karena library official sulit terutama bagi orang baru / awam / pemula.
Membuat Secret Api Key #
- Service Account
- Buka browser kamu console.cloud.google.com
- Bikin Project / Pilih Project
- Buka Tab Api & services
- Tap Create Credentials
- Pilih Service Account
instruksi Full Silahkan liat video di bawah ini
create_service_account_googleapis.webm
Install library #
dart pub add googleapis_client
Add Library #
import 'package:googleapis_client/googleapis_client.dart';
Quickstart #
import 'dart:convert';
import 'dart:io';
import 'package:googleapis_client/googleapis_client.dart';
void prettyPrint(dynamic data) {
if (data is Map || data is List) {
print(JsonEncoder.withIndent(" " * 2).convert(data));
} else {
print(data.toString());
}
}
void main(List<String> args) async {
File file = File("./test.json");
Map jsonKey = json.decode(file.readAsStringSync());
GoogleApisClient googleApisClient = GoogleApisClient(
googleApisClientApiKey: GoogleApisClientApiKey(jsonKey),
);
print((await googleApisClient.youtube.addComment(videoId: "HV4kn5j7IwQ", text: "Hai ini pesan automatis")));
}