AccessToken.fromJson constructor
convert the data provided for the platform channel to one instance of AccessToken
json
data returned by the platform channel
Implementation
factory AccessToken.fromJson(Map<String, dynamic> json) {
return AccessToken(
userId: json['userId'],
token: json['tokenString'],
expirationDate: DateTime.parse(json['expirationDate']),
refreshDate: DateTime.parse(json['refreshDate']),
appID: json['appID'],
graphDomain: json['graphDomain'],
isExpired: json['isExpired'],
declinedPermissions: json['declinedPermissions'] != null ? List<String>.from(json['declinedPermissions']) : null,
permissions: json['permissions'] != null ? List<String>.from(json['permissions']) : null,
dataAccessExpirationDate: DateTime.parse(json['dataAccessExpirationDate']),
);
}