src property
The URL or path to the 3D model. This parameter is required. Only glTF/GLB models are supported.
The parameter value must conform to the following:
-
http://
andhttps://
for HTTP(S) URLs (for example,https://modelviewer.dev/shared-assets/models/Astronaut.glb
) -
file://
for local files (NOT AVAILABLE in Web) -
a relative pathname for Flutter app assets (for example,
assets/MyModel.glb
) -
a
data:
data URI containing the model's data
<model-viewer>
official document: https://modelviewer.dev/docs/#entrydocs-loading-attributes-src
Implementation
final String src;