cache property
FlexLayoutCache
get
cache
Accessor for the flex layout cache.
Provides access to cached layout information including line data, spacing, and size calculations from the most recent layout pass. This cache is used to optimize subsequent layout operations and provide consistent layout data.
The cache is only available after a full layout pass has completed. Attempting to access it before layout or during dry layout will trigger an assertion error in debug mode.
Throws an AssertionError if accessed before layout is complete.
Implementation
FlexLayoutCache get cache {
assert(
_cache != null,
'cache is only available after layout (not dry layout)',
);
return _cache!;
}