markNeedsLayout method Null safety

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() {
  _paragraph = null;
  _lineMetricsCache = null;
  _previousCaretPosition = null;
  _previousCaretPrototype = null;
}