parseTrafficResponse static method

Map<String, List<SubredditTraffic>> parseTrafficResponse(
  1. Map response
)

Build a map of List<SubredditTraffic> given raw traffic response from the Reddit API.

This is used by the Objector to parse the traffic response, and may be made internal at some point.

Implementation

static Map<String, List<SubredditTraffic>> parseTrafficResponse(
    Map response) {
  return <String, List<SubredditTraffic>>{
    'hour': _generateTrafficList(response['hour']),
    'day': _generateTrafficList(response['day'], isDay: true),
    'month': _generateTrafficList(response['month']),
  };
}