PaginatedCoins.fromJson constructor

PaginatedCoins.fromJson(
  1. dynamic data
)

Implementation

factory PaginatedCoins.fromJson(dynamic data) {
  List<CoinStruct> list = [];
  if (data['data'] != null) {
    for (var coin in data['data']) {
      list.add(CoinStruct.fromJson(coin));
    }
  }

  return PaginatedCoins(
    list,
    data['nextCursor'],
    data['hasNextPage'],
  );
}