GText constructor
GText({
- String? text,
- ParagraphStyle? paragraphStyle,
- TextStyle? textStyle,
- 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);
}