collect static method

Simplifies creating a list of objects from JSON payload.

Implementation

static List<HeartbeatSeriesMeasurement> collect(List<dynamic> list) {
  final measurements = <HeartbeatSeriesMeasurement>[];
  for (final Map<String, dynamic> map in list) {
    final measurement = HeartbeatSeriesMeasurement.fromJson(map);
    measurements.add(measurement);
  }
  return measurements;
}