TextStyle class

An immutable style describing how to format and paint text.

This class follows Flutter's TextStyle API but only exposes properties that are supported by OpenTUI for terminal text rendering.

Constructors

TextStyle({Color color = Color.white, Color? backgroundColor, FontWeight? fontWeight, FontStyle? fontStyle, List<TextDecoration>? decoration, TextEffect? effect, int? attributes})
Creates a text style.
const

Properties

attributes int
Raw attributes for direct OpenTUI control.
final
backgroundColor Color?
The color to use as the background for the text.
final
color Color
The color of the text.
final
computedAttributes int
A computed property that converts Flutter-style properties to OpenTUI attributes.
no setter
decoration List<TextDecoration>?
A list of strings that specify the text decoration (e.g., underline).
final
effect TextEffect?
Terminal-specific text effects (blink, reverse video).
final
fontStyle FontStyle?
The typeface variant to use when drawing the letters (e.g., italics).
final
fontWeight FontWeight?
The typeface thickness to use when painting the text (e.g., bold).
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

Create blinking text style
bold() TextStyle
Create bold text style
copyWith({Color? color, Color? backgroundColor, FontWeight? fontWeight, FontStyle? fontStyle, List<TextDecoration>? decoration, TextEffect? effect, int? attributes}) TextStyle
Copy with different properties
dim() TextStyle
Create dimmed text style
italic() TextStyle
Create italic text style
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reverse() TextStyle
Create reversed text style (swap fg/bg)
strikethrough() TextStyle
Create strikethrough text style
toString() String
A string representation of this object.
inherited
underline() TextStyle
Create underlined text style

Operators

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