SceneView constructor
- SceneController? controller,
- ImageResolver? imageResolver,
- SceneStaticLayerCache? staticLayerCache,
- SceneTextLayoutCache? textLayoutCache,
- SceneStrokePathCache? strokePathCache,
- SceneViewPointerSampleCallback? onPointerSampleBefore,
- SceneViewPointerSampleCallback? onPointerSampleAfter,
- ValueChanged<
SceneController> ? onControllerReady, - PointerInputSettings? pointerSettings,
- double? dragStartSlop,
- String nodeIdGenerator()?,
- Color selectionColor = const Color(0xFF1565C0),
- double selectionStrokeWidth = 1,
- double gridStrokeWidth = 1,
- Key? key,
Creates a view for the provided controller.
If controller is null, the view creates and owns a controller with an
empty scene. Use onControllerReady to access the internal controller once
it is created.
When controller is null, pointerSettings, dragStartSlop, and
nodeIdGenerator are used to configure the internal controller.
These parameters are ignored when an external controller is provided.
If staticLayerCache is null, the view creates and owns an internal cache
and disposes it when the view is disposed. If a cache is provided, the
caller owns it and must dispose it.
If textLayoutCache / strokePathCache are null, the view creates and
owns internal LRU caches to reduce per-frame work. If caches are provided,
the caller owns them.
onPointerSampleBefore / onPointerSampleAfter let apps hook into the
pointer pipeline without re-implementing input dispatch. The call order
for each pointer sample is:
- Create PointerSample from the Flutter event
- Invoke
onPointerSampleBefore - Call
controller.handlePointer(sample) - Invoke
onPointerSampleAfter - Process internal pointer signals (double-tap) and schedule pending flush
Callbacks run synchronously and must not block for long.
Implementation
const SceneView({
this.controller,
this.imageResolver,
this.staticLayerCache,
this.textLayoutCache,
this.strokePathCache,
this.onPointerSampleBefore,
this.onPointerSampleAfter,
this.onControllerReady,
this.pointerSettings,
this.dragStartSlop,
this.nodeIdGenerator,
this.selectionColor = const Color(0xFF1565C0),
this.selectionStrokeWidth = 1,
this.gridStrokeWidth = 1,
super.key,
});