TextComponent constructor

TextComponent(
  1. String _text,
  2. RenderComponent renderComponent, {
  3. TextStyle? style,
})

Implementation

TextComponent(this._text, RenderComponent renderComponent, {TextStyle? style})
    : _textStyle = style ?? defaultTextStyle,
      _textPainter = TextPainter(textDirection: TextDirection.ltr),
      _drawable = DrawableText() {
  setPhase(ComponentPhases.preDraw);
  renderComponent.drawable = _drawable..textPainter = _textPainter;
}