fromAsset static method

Future<Node> fromAsset(
  1. String assetPath
)

The asset file should be in a format that can be converted to a scene graph node.

Flutter Scene uses a specialized 3D model format (.model) internally. You can convert standard glTF binaries (.glb files) to this format using Flutter Scene's offline importer tool.

Example:

final node = await Node.fromAsset('path/to/asset.model');

Implementation

static Future<Node> fromAsset(String assetPath) async {
  final buffer = await rootBundle.load(assetPath);
  return fromFlatbuffer(buffer);
}