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