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
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
andtextScaler
totext
and lays it out to create a Paragraph. The Paragraph is cached and can be retrieved with the samekey
by calling getLayoutFromCache. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited