Text displays a string of text allowing styling:
Text( "This is a text",)
The most common properties of the Text widget are as follows:
- style: A class that composes the styling of text. It exposes properties that allow changing the text color, background, font family (allowing the usage of a custom font from assets; see Chapter 3, An Introduction to Flutter), line height, font size, and so on.
- textAlign: Controls the text horizontal alignment, giving options such as center aligned or justified, for example.
- maxLines: Allows specifying a maximum number of lines for the text that will be truncated if the limit is exceeded.
- overflow: Will define how the text will be truncated on overflows, giving options such as specifying ...