Path.fromJson constructor

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

Creates a new Path instance from a JSON object.

Implementation

factory Path.fromJson(Map<String, dynamic> json) {
  return Path(
    items: ((json[ApiFields.path] as List?) ?? [])
        .map((shapePoint) => PathItem.fromJson(shapePoint))
        .toList(),
  );
}