getUserProfile method

Future<GoogleUser> getUserProfile()

Makes an API call to google to get the users profile.

Implementation

Future<GoogleUser> getUserProfile() async {
  var request = new Request(HttpMethod.Get,
      "https://www.googleapis.com/oauth2/v1/userinfo?alt=json");
  var resp = await send(request);
  var json = Convert.jsonDecode(resp.body);
  return GoogleUser.fromJson(json);
}