markNeedsLayout method

void markNeedsLayout()

Marks this text painter's layout information as dirty and removes cached information.

Uses this method to notify text painter to relayout in the case of layout changes in engine. In most cases, updating text painter properties in framework will automatically invoke this method.

Implementation

void markNeedsLayout() {
  assert(() {
    if (_layoutCache != null) {
      _debugMarkNeedsLayoutCallStack ??= StackTrace.current;
    }
    return true;
  }());
  _layoutCache?.paragraph.dispose();
  _layoutCache = null;
}