Skip to content

_cachedBaselines not clear when relayout #101179

@hackware1993

Description

@hackware1993
@override
void markNeedsLayout() {
  if ((_cachedBaselines != null && _cachedBaselines!.isNotEmpty) ||
      (_cachedIntrinsicDimensions != null && _cachedIntrinsicDimensions!.isNotEmpty) ||
      (_cachedDryLayoutSizes != null && _cachedDryLayoutSizes!.isNotEmpty)) {
    // If we have cached data, then someone must have used our data.
    // Since the parent will shortly be marked dirty, we can forget that they
    // used the baseline and/or intrinsic dimensions. If they use them again,
    // then we'll fill the cache again, and if we get dirty again, we'll
    // notify them again.
    **_cachedBaselines?.clear();**
    _cachedIntrinsicDimensions?.clear();
    _cachedDryLayoutSizes?.clear();
    if (parent is RenderObject) {
      markParentNeedsLayout();
      return;
    }
  }
  super.markNeedsLayout();
}

_cachedBaselines only be cleared in markNeedsLayout,but i think it should also be cleared in layout(when parent relayout it,)

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopa: layoutSystemChrome and Framework's Layout Issuesfound in release: 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions