SceneView constructor

const SceneView(
  1. Scene scene, {
  2. Key? key,
  3. Camera? camera,
  4. SceneCameraBuilder? cameraBuilder,
  5. SceneViewsBuilder? viewsBuilder,
  6. bool autoTick = true,
  7. double? pixelRatio,
  8. SceneTickCallback? onTick,
  9. ResourceGroup? loading,
  10. SceneLoadingBuilder? loadingBuilder,
  11. Duration revealMinDuration = Duration.zero,
  12. bool warmUp = false,
  13. bool debugWidgetInput = false,
  14. List<Widget> children = const [],
})

Renders scene, driving a repaint each frame.

At most one of camera, cameraBuilder, or viewsBuilder may be provided. When none is, the view renders through the scene's primary camera (Scene.camera), falling back to a default camera when the scene has none, so SceneView(scene) always renders something.

Implementation

const SceneView(
  Scene this.scene, {
  super.key,
  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 [],
}) : environment = null,
     environmentIntensity = 1.0,
     exposure = 1.0,
     toneMapping = null,
     assert(
       (camera != null ? 1 : 0) +
               (cameraBuilder != null ? 1 : 0) +
               (viewsBuilder != null ? 1 : 0) <=
           1,
       'Provide at most one of camera, cameraBuilder, or viewsBuilder.',
     );