Oauth2Token.fromMap constructor

Oauth2Token.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory Oauth2Token.fromMap(
  Map<String, dynamic> map,
) {
  map = {
    'access_token': "",
    'token_type': "Bearer",
    'expires_in': 0,
    'refresh_token': "",
    'scope': "",
    ...map,
  };

  return Oauth2Token(
    access_token: map['access_token'].toString(),
    token_type: map['token_type'].toString(),
    expires_in: map['expires_in'],
    refresh_token: map['refresh_token'].toString(),
    scope: map['scope'].toString(),
    authorization_details: map['authorization_details']?.toString(),
    id_token: map['id_token']?.toString(),
  );
}