Skip to content
On this page

ModelViewer

A viewer for three-dimensional model assets.

ModelViewer in FluttyUIModelViewer in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

ModelViewer

const ModelViewer({
  super.key,
  required this.source,
  this.controller,
  this.height = 320,
  this.borderRadius = 24,
  this.showControls = true,
  this.interactive = true,
  this.backgroundColor,
  this.label = '3D model',
  this.rotationSensitivity = .35,
  this.exposure = 1,
  this.loadTimeout = const Duration(seconds: 45),
  this.onLoaded,
  this.onError,
  this.onRotationChanged,
  this.onInteractionStart,
  this.onInteractionEnd,
  this.rendererBuilder,
  this.motion,
});
ParameterTypeRequiredDefault
keyKey?Nonull
sourceModelSourceYes—
controllerModelViewerController?Nonull
heightdoubleNo320
borderRadiusdoubleNo24
showControlsboolNotrue
interactiveboolNotrue
backgroundColorColor?Nonull
labelStringNo'3D model'
rotationSensitivitydoubleNo.35
exposuredoubleNo1
loadTimeoutDurationNoconst Duration(seconds: 45)
onLoadedVoidCallback?Nonull
onErrorValueChanged<String>?Nonull
onRotationChangedValueChanged<ModelRotation>?Nonull
onInteractionStartVoidCallback?Nonull
onInteractionEndVoidCallback?Nonull
rendererBuilderModelViewerRendererBuilder?Nonull
motionComponentMotion?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/media/model_viewer/model_viewer.dart

This reference is generated from the ModelViewer declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI