OAuthCredentials.fromJson constructor

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

Implementation

factory OAuthCredentials.fromJson(Map<String, dynamic> json) {
  return OAuthCredentials(
    accessToken: json['access_token'] as String,
    refreshToken: json['refresh_token'] as String?,
    expiration: json['expiration'] == null ? null : DateTime.parse(json['expiration'] as String),
    scopes: (json['scopes'] as List?)?.whereType<String>().toList(),
  );
}