parse static method

List<RouteDescription>? parse(
  1. String output
)

Implementation

static List<RouteDescription>? parse(String output) {
  final markerIndex = output.indexOf(marker);
  if (markerIndex < 0) return null;

  try {
    final decoded = jsonDecode(
      output.substring(markerIndex + marker.length).trim(),
    );
    if (decoded is! List) return null;
    return decoded
        .map(RouteDescription.fromJson)
        .whereType<RouteDescription>()
        .toList();
  } on FormatException {
    return null;
  }
}