TokensResponse.fromJson constructor

TokensResponse.fromJson(
  1. Map<String, dynamic> parsedJson
)

Implementation

factory TokensResponse.fromJson(Map<String, dynamic> parsedJson) {
  var tokensFromJson = parsedJson['tokens'] as List;
  List<Token> tokensList =
      tokensFromJson.map((i) => Token.fromJson(i)).toList();
  final pendingItems = parsedJson['pendingItems'] as int?;
  return TokensResponse(tokens: tokensList, pendingItems: pendingItems);
}