Polyline.fromJson constructor

Polyline.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Polyline.fromJson(Map<String, dynamic> json) {
  return Polyline(
    id: json['id'],
    points: (json['points'] as List).map((e) => LatLng.fromJson(e)).toList(),
    color: json['color'] != null
        ? Color(int.parse(json['color'].toString()))
        : null,
    width: json['width']?.toDouble(),
    alpha: json['alpha']?.toDouble(),
  );
}