ContentfulWidgetDetector class

Utility class to detect if a widget or render object contains contentful painting that should trigger FCP (First Contentful Paint) and LCP (Largest Contentful Paint).

Constructors

ContentfulWidgetDetector()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getContentfulPaintAreaFromFlutterWidget(RenderObject? renderObject) double
Gets the largest visible area of contentful render objects created by Flutter widgets. For LCP, we need the largest single contentful element, not the sum. Returns 0 if no contentful paint is found.
getVisibleArea(RenderObject renderObject) double
Gets the visible area of a render object for LCP calculation
hasContentfulChild(Widget widget) bool
Recursively checks if a widget or its descendants contain contentful painting
hasContentfulPaint(RenderObject? renderObject) bool
Checks if a RenderObject tree contains any contentful painting
hasContentfulPaintFromFlutterWidget(RenderObject? renderObject) bool
Checks if a RenderObject tree contains contentful painting, but only checks render objects created by Flutter widgets (not RenderBoxModel or RenderWidget)
isContentfulWidget(Widget widget) bool
Checks if a widget is considered contentful (including checking children for layout widgets)