AssetLoaderOperations mixin

Mixin that helps load Flutter assets into the model-viewer WebView.

The WebView cannot reach the Flutter asset bundle directly, so these helpers convert asset bytes to base-64 data URIs that model-viewer can use as environment-image or skybox-image values.

Call these methods inside the ModelViewerProViewer.onLoad callback, after the page is fully ready:

ModelViewerProViewer(
  src: 'assets/model.glb',
  controller: _controller,
  onLoad: (meshes) async {
    await _controller.loadSkyboxFromAsset('assets/skybox.hdr');
  },
)
Mixin applications

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
webViewController → WebViewController?
The WebViewController supplied by the owning controller.
no setter

Methods

loadEnvironmentFromAsset(String assetPath) Future<bool>
Loads an environment / reflection image from assetPath.
loadSkyboxFromAsset(String assetPath) Future<bool>
Loads a skybox image from assetPath and applies it to model-viewer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited