VisibilityDetectorLayer class
The Layer corresponding to a VisibilityDetector widget.
We use a Layer because we can directly determine visibility by virtue of being added to the SceneBuilder.
- Inheritance
- 
    - Object
- Layer
- ContainerLayer
- VisibilityDetectorLayer
 
Constructors
- VisibilityDetectorLayer({required Key key, required Offset widgetOffset, required Size widgetSize, required Offset paintOffset, required VisibilityChangedCallback onVisibilityChanged})
- Constructor. See the corresponding properties for parameter details.
Properties
- alwaysNeedsAddToScene → bool
- 
  Subclasses may override this to true to disable retained rendering.
  no setterinherited
- attached → bool
- 
  Whether the layer tree containing this layer is attached to an owner.
  no setterinherited
- debugCreator ↔ Object?
- 
  The object responsible for creating this layer.
  getter/setter pairinherited
- debugDisposed → bool
- 
  If asserts are enabled, returns whether dispose has
been called since the last time any retained resources were created.
  no setterinherited
- debugHandleCount → int
- 
  Returns the number of objects holding a LayerHandle to this layer.
  no setterinherited
- debugSubtreeNeedsAddToScene → bool?
- 
  Whether this or any descendant layer in the subtree needs addToScene.
  no setterinherited
- depth → int
- 
  The depth of this layer in the layer tree.
  no setterinherited
- engineLayer ↔ EngineLayer?
- 
  Stores the engine layer created for this layer in order to reuse engine
resources across frames for better app performance.
  getter/setter pairinherited
- firstChild → Layer?
- 
  The first composited layer in this layer's child list.
  no setterinherited
- hasChildren → bool
- 
  Returns whether this layer has at least one child layer.
  no setterinherited
- hashCode → int
- 
  The hash code for this object.
  no setterinherited
- key → Key
- 
  The key for the corresponding VisibilityDetector widget.
  final
- lastChild → Layer?
- 
  The last composited layer in this layer's child list.
  no setterinherited
- nextSibling → Layer?
- 
  This layer's next sibling in the parent layer's child list.
  no setterinherited
- onVisibilityChanged → VisibilityChangedCallback
- 
  See VisibilityDetector.onVisibilityChanged.
  final
- owner → Object?
- 
  The owner for this layer (null if unattached).
  no setterinherited
- paintOffset → Offset
- 
  The offset supplied to RenderVisibilityDetector.paint method.
  final
- parent → ContainerLayer?
- 
  This layer's parent in the layer tree.
  no setterinherited
- previousSibling → Layer?
- 
  This layer's previous sibling in the parent layer's child list.
  no setterinherited
- runtimeType → Type
- 
  A representation of the runtime type of the object.
  no setterinherited
- subtreeHasCompositionCallbacks → bool
- 
  Whether the subtree rooted at this layer has any composition callback
observers.
  no setterinherited
- widgetOffset → Offset
- 
  Offset to the start of the widget, in local coordinates.
  final
- widgetSize → Size
- 
  The size of the corresponding VisibilityDetector widget.
  final
Methods
- 
  addChildrenToScene(SceneBuilder builder) → void 
- 
  Uploads all of this layer's children to the engine.
  inherited
- 
  addCompositionCallback(CompositionCallback callback) → VoidCallback 
- 
  Adds a callback for when the layer tree that this layer is part of gets
composited, or when it is detached and will not be rendered again.
  inherited
- 
  addToScene(SceneBuilder builder, [Offset layerOffset = Offset.zero]) → void 
- 
  See Layer.addToScene.
  override
- 
  append(Layer child) → void 
- 
  Adds the given layer to the end of this layer's child list.
  inherited
- 
  applyTransform(Layer? child, Matrix4 transform) → void 
- 
  Applies the transform that would be applied when compositing the given
child to the given matrix.
  inherited
- 
  attach(covariant Object owner) → void 
- 
  See AbstractNode.attach.
  override
- 
  buildScene(SceneBuilder builder) → Scene 
- 
  Consider this layer as the root and build a scene (a tree of layers)
in the engine.
  inherited
- 
  debugDescribeChildren() → List< DiagnosticsNode> 
- 
  Returns a list of DiagnosticsNode objects describing this node's
children.
  inherited
- 
  debugFillProperties(DiagnosticPropertiesBuilder properties) → void 
- 
  See Diagnosticable.debugFillProperties.
  override
- 
  debugMarkClean() → void 
- 
  Mark that this layer is in sync with engine.
  inherited
- 
  depthFirstIterateChildren() → List< Layer> 
- 
  Returns the descendants of this layer in depth first order.
  inherited
- 
  describeClipBounds() → Rect? 
- 
  Describes the clip that would be applied to contents of this layer,
if any.
  inherited
- 
  detach() → void 
- 
  See AbstractNode.detach.
  override
- 
  dispose() → void 
- 
  Clears any retained resources that this layer holds.
  inherited
- 
  find<S extends Object> (Offset localPosition) → S? 
- 
  Search this layer and its subtree for the first annotation of type Sunder the point described bylocalPosition.inherited
- 
  findAllAnnotations<S extends Object> (Offset localPosition) → AnnotationResult< S> 
- 
  Search this layer and its subtree for all annotations of type Sunder the point described bylocalPosition.inherited
- 
  findAnnotations<S extends Object> (AnnotationResult< S> result, Offset localPosition, {required bool onlyFirst}) → bool
- 
  Search this layer and its subtree for annotations of type Sat the location described bylocalPosition.inherited
- 
  markNeedsAddToScene() → void 
- 
  Mark that this layer has changed and addToScene needs to be called.
  inherited
- 
  noSuchMethod(Invocation invocation) → dynamic 
- 
  Invoked when a nonexistent method or property is accessed.
  inherited
- 
  redepthChild(Layer child) → void 
- 
  Adjust the depth of the given childto be greater than this node's own depth.inherited
- 
  redepthChildren() → void 
- 
  Adjust the depth of this node's children, if any.
  inherited
- 
  remove() → void 
- 
  Removes this layer from its parent layer's child list.
  inherited
- 
  removeAllChildren() → void 
- 
  Removes all of this layer's children from its child list.
  inherited
- 
  supportsRasterization() → bool 
- 
  Whether or not this layer, or any child layers, can be rasterized with
ui.Scene.toImage or ui.Scene.toImageSync.
  inherited
- 
  toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode 
- 
  Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
  inherited
- 
  toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String 
- 
  A string representation of this object.
  inherited
- 
  toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String 
- 
  Returns a string representation of this node and its descendants.
  inherited
- 
  toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String 
- 
  Returns a one-line detailed description of the object.
  inherited
- 
  toStringShort() → String 
- 
  A brief description of this object, usually just the runtimeType and the
hashCode.
  inherited
- 
  updateSubtreeNeedsAddToScene() → void 
- 
  Traverses the layer subtree starting from this layer and determines whether it needs addToScene.
  inherited
Operators
- 
  operator ==(Object other) → bool 
- 
  The equality operator.
  inherited
Static Properties
- 
  widgetBounds
  → Map<Key, Rect> 
- 
  Keeps track of the last known bounds of a VisibilityDetector, in global
coordinates.
  no setter
Static Methods
- 
  forget(Key key) → void 
- Removes entries corresponding to the specified Key from our internal caches.
- 
  notifyNow() → void 
- See VisibilityDetectorController.notifyNow.