lines static method

List<Line> lines(
  1. dynamic json
)

returns a list of lines from a json object

Implementation

static List<Line> lines(dynamic json) {
  if (json == null) {
    return [];
  } else if (json is List) {
    return json.map((e) => Line.fromJson(e)).toList();
  } else if (json['edges'] == null) {
    return [];
  }

  return (json['edges'] as List).map((e) => Line.fromGraphJson(e)).toList();
}