VisibilityInfo class

Data passed to the VisibilityDetector.onVisibilityChanged callback.

Contains information about the widget's visibility state including:

  • key: The unique identifier for the widget
  • size: The total size of the widget
  • visibleBounds: The visible portion in local coordinates
  • visibleFraction: A value from 0.0 (invisible) to 1.0 (fully visible)
Annotations

Constructors

VisibilityInfo({required Key key, Size? size, Rect? visibleBounds})
Constructor.
const
VisibilityInfo.fromRects({required Key key, required Rect widgetBounds, required Rect clipRect})
Constructs a VisibilityInfo from widget bounds and a corresponding clipping rectangle.
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
isFullyVisible → bool
Returns true if the widget is fully visible (100% visible).
no setter
isInvisible → bool
Returns true if the widget is completely invisible (0% visible).
no setter
isPartiallyVisible → bool
Returns true if the widget is partially visible (between 0% and 100%).
no setter
isVisible → bool
Returns true if the widget is at least partially visible (> 0%).
no setter
key → Key
The key for the corresponding VisibilityDetector widget.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → Size
The size of the widget.
final
visibleBounds → Rect
The visible portion of the widget, in the widget's local coordinates.
final
visibleFraction → double
A fraction in the range [0, 1] that represents what proportion of the widget is visible (assuming rectangular bounding boxes).
no setter

Methods

matchesVisibility(VisibilityInfo info) → bool
Returns true if the specified VisibilityInfo object has equivalent visibility to this one.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override