SceneView.declarative constructor
const
SceneView.declarative({
- Key? key,
- EnvironmentMap? environment,
- double environmentIntensity = 1.0,
- double exposure = 1.0,
- ToneMappingMode toneMapping = ToneMappingMode.pbrNeutral,
- Camera? camera,
- SceneCameraBuilder? cameraBuilder,
- SceneViewsBuilder? viewsBuilder,
- bool autoTick = true,
- double? pixelRatio,
- SceneTickCallback? onTick,
- ResourceGroup? loading,
- SceneLoadingBuilder? loadingBuilder,
- Duration revealMinDuration = Duration.zero,
- bool warmUp = false,
- bool debugWidgetInput = false,
- List<
Widget> children = const [],
Renders a view-owned Scene described declaratively by children.
The view constructs and owns an internal Scene; scene widgets in
children populate it, and the scene-level props (environment,
exposure, toneMapping, ...) configure it. Omitted props mean the
scene defaults; removing a prop on a later build restores its default.
SceneView.declarative(
children: [
SceneMesh(geometry: geometry, material: material),
],
)
Implementation
const SceneView.declarative({
super.key,
this.environment,
this.environmentIntensity = 1.0,
this.exposure = 1.0,
ToneMappingMode this.toneMapping = ToneMappingMode.pbrNeutral,
this.camera,
this.cameraBuilder,
this.viewsBuilder,
this.autoTick = true,
this.pixelRatio,
this.onTick,
this.loading,
this.loadingBuilder,
this.revealMinDuration = Duration.zero,
this.warmUp = false,
this.debugWidgetInput = false,
this.children = const [],
}) : scene = null,
assert(
(camera != null ? 1 : 0) +
(cameraBuilder != null ? 1 : 0) +
(viewsBuilder != null ? 1 : 0) <=
1,
'Provide at most one of camera, cameraBuilder, or viewsBuilder.',
);