GText constructor

GText({
  1. String? text,
  2. ParagraphStyle? paragraphStyle,
  3. TextStyle? textStyle,
  4. double width = double.infinity,
})

Creates a new GText instance.

The text parameter specifies the text that will be displayed. The paragraphStyle parameter specifies the paragraph style of the text. The textStyle parameter specifies the text style of the text. The width parameter specifies the width of the text.

Implementation

GText({
  String? text,
  ui.ParagraphStyle? paragraphStyle,
  painting.TextStyle? textStyle,
  double width = double.infinity,
}) {
  painting.PaintingBinding.instance.systemFonts.addListener(_fontLoaded);
  this.text = text;

  _width = width;
  _invalidBuilder = true;
  _invalidSize = true;
  setTextStyle(textStyle ?? defaultTextStyle);
  setParagraphStyle(paragraphStyle ?? defaultParagraphStyle);
}