fromAsset<T, C> static method
Convenience method to load graph from asset file.
Implementation
static Future<NodeGraph<T, C>> fromAsset<T, C>(
String assetPath,
T Function(Object? json) fromJsonT,
C Function(Object? json) fromJsonC, {
Node<T> Function(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
)?
nodeFromJson,
}) async {
final String jsonString = await rootBundle.loadString(assetPath);
return fromJsonString<T, C>(
jsonString,
fromJsonT,
fromJsonC,
nodeFromJson: nodeFromJson,
);
}