ParagraphCache class

A cache of laid out Paragraphs. This is used to avoid laying out the same text multiple times, which is expensive.

Constructors

ParagraphCache.new(int maximumSize)
UncompleteDocumentation

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
Returns the number of Paragraphs in the cache.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clears the cache. This should be called when the same text and style pair no longer produces the same layout. For example, when a font is loaded.
getLayoutFromCache(int key) Paragraph?
Returns a Paragraph for the given key. key is the same as the key argument to performAndCacheLayout.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performAndCacheLayout(String text, TextStyle style, TextScaler textScaler, int key) Paragraph
Applies style and textScaler to text and lays it out to create a Paragraph. The Paragraph is cached and can be retrieved with the same key by calling getLayoutFromCache.
toString() String
A string representation of this object.
inherited

Operators

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