needsPaintForMode static method
Whether the boundary still owes a paint, to the extent the build mode can answer that at all.
RenderObject.debugNeedsPaint is debug-only: it returns a late field
assigned inside an assert, so profile and release strip the assignment
and reading it throws LateInitializationError. Capture is supported
outside debug — PatchbayRoot wraps the root boundary whenever
!kReleaseMode — so outside debug this answers "cannot tell" rather than
letting that error escape the bridge as an untyped host failure. Nothing
is silently admitted: a boundary that really has not painted still fails
closed one step later, where toImage throws and capture rejects with
captureEncodingFailed.
Implementation
@visibleForTesting
static bool needsPaintForMode(
RenderRepaintBoundary boundary, {
required bool isDebugBuild,
}) => isDebugBuild && boundary.debugNeedsPaint;