model_viewer_pro 1.0.2
model_viewer_pro: ^1.0.2 copied to clipboard
Display and control interactive 3D models (GLB/GLTF) in Flutter — mesh manipulation, camera control, animations, grounded environments, and custom lighting. 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.
1.0.2 — 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