getAccessToken method
Use the authorization code GET parameter sent back to your redirect_uri to get an access_token.
Save the access_token so your app can authenticate the user by sending the Authorization header.
The access_token is valid for 3 months. Save and use the refresh_token to get a new access_token without asking the user to re-authenticate.
Implementation
Future<AccessTokenResponse> getAccessToken(String code) async {
return _oauthToken({"code": code});
}