fromUrl static method

Future<NodeGraph<Map<String, dynamic>>> fromUrl(
  1. String url, {
  2. Annotation annotationFromJson(
    1. Map<String, dynamic> json
    ) = defaultAnnotationFromJson,
})

Implementation

static Future<NodeGraph<Map<String, dynamic>>> fromUrl(
  String url, {
  Annotation Function(Map<String, dynamic> json) annotationFromJson =
      defaultAnnotationFromJson,
}) async {
  final response = await http.get(Uri.parse(url));
  final Map<String, dynamic> json = jsonDecode(response.body);
  return fromJsonMap(json, annotationFromJson: annotationFromJson);
}