SceneModel constructor

SceneModel(
  1. String assetPath, {
  2. Key? key,
  3. String? variant,
  4. List<SceneAnimationSpec> animations = const [],
  5. WidgetBuilder? placeholder,
  6. Widget error(
    1. BuildContext context,
    2. Object error
    )?,
  7. void onLoaded(
    1. Node modelRoot
    )?,
  8. String? name,
  9. Vector3? position,
  10. Quaternion? rotation,
  11. Vector3? scale,
  12. Matrix4? transform,
  13. bool visible = true,
  14. List<Component> components = const [],
  15. SceneNodeController? controller,
  16. List<Widget> children = const [],
})

Loads the model from the asset bundle at assetPath.

Not const because the source is derived; use SceneModel.from with a const AssetModelSource when const construction matters.

Implementation

SceneModel(
  String assetPath, {
  super.key,
  this.variant,
  this.animations = const [],
  this.placeholder,
  this.error,
  this.onLoaded,
  super.name,
  super.position,
  super.rotation,
  super.scale,
  super.transform,
  super.visible,
  super.components,
  super.controller,
  super.children,
}) : source = AssetModelSource(assetPath);