fromJsonString<T> static method

NodeGraph<T> fromJsonString<T>(
  1. String jsonString,
  2. T fromJsonT(
    1. Object? json
    ), {
  3. Annotation annotationFromJson(
    1. Map<String, dynamic> json
    ) = defaultAnnotationFromJson,
})

Convenience method to load graph from JSON string

Implementation

static NodeGraph<T> fromJsonString<T>(
  String jsonString,
  T Function(Object? json) fromJsonT, {
  Annotation Function(Map<String, dynamic> json) annotationFromJson =
      defaultAnnotationFromJson,
}) {
  final Map<String, dynamic> json = jsonDecode(jsonString);
  return NodeGraph<T>.fromJson(
    json,
    fromJsonT,
    annotationFromJson: annotationFromJson,
  );
}