TextConfig class

A Text Config contains all typographical information required to render texts; i.e., font size and color, family, etc.

It does not hold information regarding the position of the text to be render neither the text itself (the string). To hold all those information, use the Text component.

It is used by TextComponent.

Constructors

TextConfig({double fontSize: 24.0, Color color: const Color(0xFF000000), String fontFamily: 'Arial', TextAlign textAlign: TextAlign.left, TextDirection textDirection: TextDirection.ltr})
Creates a constant TextConfig with sensible defaults. [...]

Properties

color Color
The font color to be used. [...]
final
fontFamily String
The font family to be used. You can use available by default fonts for your platform (like Arial), or you can add custom fonts. [...]
final
fontSize double
The font size to be used, in points.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
textAlign TextAlign
The TextAlign to be used when creating the material.TextPainter. [...]
final
textDirection TextDirection
The direction to render this text (left to right or right to left). [...]
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
render(Canvas canvas, String text, Position p, {Anchor anchor: Anchor.topLeft}) → void
Renders a given text in a given position p using the provided canvas and anchor. [...]
toString() String
Returns a string representation of this object.
inherited
toTextPainter(String text) TextPainter
Returns a material.TextPainter that allows for text rendering and size measuring. [...]
withColor(Color color) TextConfig
Creates a new TextConfig changing only the color. [...]
withFontFamily(String fontFamily) TextConfig
Creates a new TextConfig changing only the fontFamily. [...]
withFontSize(double fontSize) TextConfig
Creates a new TextConfig changing only the fontSize. [...]
withTextAlign(TextAlign textAlign) TextConfig
Creates a new TextConfig changing only the textAlign. [...]
withTextDirection(TextDirection textDirection) TextConfig
Creates a new TextConfig changing only the textDirection. [...]

Operators

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