DEPRECATED (looking for solutions)
Google jsapi loader for Dart
Dart library to use for Google jsapi / Client-side flow
Go to Google APIs Console and create a new Project
Create a new Client ID for web applications in "API Access"
Set JavaScript origins to your server or for example http://127.0.0.1:3030/ for local testing in Dartium
Add this dependency to your pubspec.yaml
dependencies:
tekartik_google_jsapi:
git:
url: https://github.com/alextekartik/google-jsapi.dart.git
Import the library in your dart application
import "package:tekartik_google_jsapi/google_jsapi.dart";
Initialize the library with your parameters
Gapi gapi;
...
loadGapi().then((Gapi gapi_) {
gapi = gapi_;
});
gapi.auth.authorize(cliendId, scopes).then(
(String oauthToken) {
print("client id '$clientId' authorized for '$scopes'";
});