collect static method

List<WorkoutRouteLocation> collect(
  1. List list
)

Simplifies creating a list of objects from JSON payload.

Implementation

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