debugProfileLayoutsEnabled top-level property Null safety
read / write
Adds dart:developer.Timeline events for every RenderObject layout.
The timing information this flag exposes is not representative of the actual cost of layout, because the overhead of adding timeline events is significant relative to the time each object takes to lay out. However, it can expose unexpected layout behavior in the timeline.
In debug builds, additional information is included in the trace (such as the properties of render objects being laid out). Collecting this data is expensive and further makes these traces non-representative of actual performance. This data is omitted in profile builds.
For more information about performance debugging in Flutter, see flutter.dev/docs/perf/rendering.
See also:
- debugPrintLayouts, which does something similar for layout but using console output.
- debugProfileBuildsEnabled, which does something similar for widgets being rebuilt.
- debugProfilePaintsEnabled, which does something similar for painting.
- debugEnhanceLayoutTimelineArguments, which enhances the trace with debugging information related to RenderObject layouts.
Implementation
bool debugProfileLayoutsEnabled = false;