OAuthResponse.fromJson constructor

OAuthResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory OAuthResponse.fromJson(Map<String, dynamic> json) => OAuthResponse(
    //Sanitize data from some servers
    json["token_type"] == "bearer" ? "Bearer" : json["token_type"],
    json.containsKey("expires_in")
        ? json["expires_in"] is int
            ? json["expires_in"]
            : int.parse(json["expires_in"])
        : 3600,
    json["refresh_token"],
    json["access_token"],
    json["id_token"],
    error: json["error"],
    errorDescription: json["error_description"]);