主题
TextTheme
自定义 Text 的样式。
Material 3 设计规范 定义了 5 组文本样式,每组 3 种字号:"Display"、"Headline"、"Title"、 "Label" 和 "Body",这些样式通用于 Flet 的各个控件。
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
body_large | Optional[TextStyle] | None | Largest of the body styles. Body styles are used for longer passages of text. |
body_medium | Optional[TextStyle] | None | Middle size of the body styles. Body styles are used for longer passages of text. The default text style for Material. |
body_small | Optional[TextStyle] | None | Smallest of the body styles. |
display_large | Optional[TextStyle] | None | Largest of the display styles. As the largest text on the screen, display styles are reserved for short, important text or numerals. They work best on large screens. |
display_medium | Optional[TextStyle] | None | Middle size of the display styles. |
display_small | Optional[TextStyle] | None | Smallest of the display styles. |
headline_large | Optional[TextStyle] | None | Largest of the headline styles. Headline styles are smaller than display styles. They're best-suited for short, high-emphasis text on smaller screens. |
headline_medium | Optional[TextStyle] | None | Middle size of the headline styles. |
headline_small | Optional[TextStyle] | None | Smallest of the headline styles. |
label_large | Optional[TextStyle] | None | Largest of the label styles. Label styles are smaller, utilitarian styles, used for areas of the UI such as text inside of components or very small supporting text in the content body, like captions. Used for text on Button, TextButton and OutlinedButton. |
label_medium | Optional[TextStyle] | None | Middle size of the label styles. |
label_small | Optional[TextStyle] | None | Smallest of the label styles. |
title_large | Optional[TextStyle] | None | Largest of the title styles. Titles are smaller than headline styles and should be used for shorter, medium-emphasis text. |
title_medium | Optional[TextStyle] | None | Middle size of the title styles. |
title_small | Optional[TextStyle] | None | Smallest of the title styles. |