TextMeasure class abstract final

A least-recently-used cache of laid out TextPainters, so drawing and measuring the same label every frame does not lay it out again.

Every text measurement and every drawText of the port goes through layout.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

cacheSize → int
The number of laid out texts currently cached.
no setter

Static Methods

clearCache() → void
Drops every cached layout.
layout(String text, TextStyle style, {double? maxWidth, int? maxLines}) → TextPainter
Returns text in style laid out left to right, at most maxWidth wide (unbounded when null) and with at most maxLines lines (unlimited when null).

Constants

maxEntries → const int
The maximum number of laid out texts that are kept.