model_viewer_pro 2.0.3
model_viewer_pro: ^2.0.3 copied to clipboard
Display & control interactive 3D models (GLB/GLTF) in Flutter. Dynamically change mesh colors, toggle visibility, control camera, lighting, & grounded scenes. Built on model_viewer_plus.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.3 — 2026-08-05 #
🛠 Fixes & Improvements #
- Pub.dev SEO Points Fix: Shortened package description in
pubspec.yamlto under 180 characters to resolve pub.dev's scoring penalty. - Robust JavaScript Injection: Resolved a race condition where the
window.modelViewerProcontext was lost during WebView HTML reloads. - Mesh Finding Accuracy: Fixed an issue where
nodeNamematching failed if model nodes had trailing spaces, ensuringsetNodeVisibilityandsetExclusiveMeshalways hit their targets. - Render Forcing Reliability: Improved the fallback render trigger to ensure Three.js correctly updates transformations (
updateMatrixWorld) and uses attributes instead of ignored JS properties. - Local Proxy Support: Added
android.permission.INTERNETto the example app to fixSocketExceptionwhen the local asset proxy server attempts to bind to127.0.0.1. - Cleaned up all Dart lint warnings.
2.0.1 — 2026-06-09 #
🛠 Fixes #
- Added
screenshotsfield topubspec.yamlto display images on pub.dev. - Linked video demo in README.
2.0.0 — 2026-06-09 #
🚀 Breaking Changes / Major Updates #
- Version 2.0.0 introduces optimized initial mesh loading and exclusive mesh grouping.
✨ New Features #
- Initial Loading Meshes (
initialLoadingMeshes): You can now provide a list of mesh names directly toModelViewerProViewer. The viewer will use a whitelist to instantly hide all other meshes when the model loads, preventing any visual "pop-in" of unwanted meshes. - Exclusive Meshes (
setExclusiveMesh(group, selectedMesh)): A new controller method that ensures only one mesh from a specified group is visible at a time. Perfect for outfit switching! - Grounded Mode Toggles: Grounded mode is now fully supported and easily togglable at runtime.
🛠 Improvements #
- Code cleanups and formatting improvements.
- Added promotional assets (screenshots and video) for pub.dev.
1.0.3 — 2026-06-01 #
🚀 Breaking Changes #
- Package renamed from
model_viewer_pro_controllertomodel_viewer_pro. Update your import topackage:model_viewer_pro/model_viewer_pro.dart. All class and method names are unchanged.
✨ New Features #
- Grounded mode (
ModelViewerProViewer.grounded) — projects the skybox onto a virtual ground plane for a realistic floor reflection, with smart automatic defaults for shadow intensity, camera orbit limits, and panning. - Local asset skybox (
skyboxImagePath) — load equirectangular images directly from the Flutter asset bundle (auto-encoded to base64 for WebView compatibility). - Lighting controls —
shadowIntensity,shadowSoftness, andexposureare now first-class constructor parameters onModelViewerProViewer, watching for changes viadidUpdateWidget. - Interaction toggles —
disablePan,disableZoom,disableTap,touchAction,maxCameraOrbit, andminCameraOrbitare all widget parameters with livedidUpdateWidgetsupport. AssetLoaderOperationsmixin —loadSkyboxFromAsset()andloadEnvironmentFromAsset()encode any Flutter asset as a base64 data URI and inject it into the WebView for reliable cross-platform asset loading.setDisablePan/setDisableZoom/setDisableTapmethods onModelViewerProController.setSkyboxHeight/removeSkyboxHeightmethods onModelViewerProController.setTouchActionmethod onModelViewerProController.executeCustomJS— run arbitrary JavaScript for one-off scene tweaks.takeScreenshot— capture the current frame as a PNG data URL.- Shared
_modelViewerProForceRenderJS helper — all scene mutations now use a single, centralised render-trigger function (camera micro-move + autoRotate toggle + materialneedsUpdateflag) instead of duplicated inline code.
🛠 Improvements #
- All Dart source files re-formatted to pass
dart formatwith zero issues. - Removed leftover
console.logdebug statements from injected JavaScript. - Fixed
if-without-braces lint warnings throughoutviewer.dart. _encodeBase64inAssetLoaderOperationsreplaced withdart:convert'sbase64Encodefor correctness and performance.debugPrintprefix updated frommodel_viewer_pro_controller:tomodel_viewer_pro:.controller.dartinternal helpers (_setAttribute/_removeAttribute) now returnFuture<bool>directly without unnecessary async wrapping.
⚠️ Deprecations #
environmentImageAssetwidget param → usecontroller.loadEnvironmentFromAsset()insideonLoad.skyboxImageAssetwidget param → usecontroller.loadSkyboxFromAsset()insideonLoad.environmentImagewidget param → useenvironmentImageUrl.skyboxImagewidget param → useskyboxImagePath.setEnvironmentImage()on controller → usesetEnvironmentImageFromUrl().setSkyboxImage()on controller → usesetSkyboxImageFromUrl().
📦 Dependencies #
model_viewer_plus: ^1.10.0webview_flutter: ^4.13.1
0.0.1 — 2026-02-21 #
Initial Release #
🎭 Mesh Operations
getAvailableMeshes()— query all named meshes from loaded models.setVisibility()— show/hide individual meshes and their children.setTextureColor()— change mesh material colours dynamically.
📸 Camera Operations
- Camera orbit, target, FOV, min/max orbit constraints, disable-pan.
🎬 Animation Operations
- Play, pause, seek, and query animation duration.
💡 Lighting Operations
- Background colour, ground visibility, shadow intensity/softness, exposure.
🌅 Environment Operations
- Environment images and skybox images from URL or Flutter assets.
🎮 Viewer Widget
ModelViewerProViewerwithcontroller,onLoad, and model-viewer passthrough props.
📦 Platform Support
- Android 6.0+, iOS 11.0+, Web (all modern browsers).
[Unreleased] #
Planned #
- Morph target / blend-shape control
- Named animation clip selection
- Material property editor (metalness, roughness, emissive)
- VR / immersive mode support
