keyByPolylineId function

Map<String, Polyline> keyByPolylineId(
  1. Iterable<Polyline> polylines
)

Implementation

Map<String, Polyline> keyByPolylineId(Iterable<Polyline> polylines) {
  // ignore: unnecessary_null_comparison
  if (polylines == null) {
    return <String, Polyline>{};
  }
  return Map<String, Polyline>.fromEntries(polylines.map((Polyline polyline) =>
      MapEntry<String, Polyline>(polyline.id, polyline.clone())));
}