聚焦文本
描述
一个专注于特定段落或短语的文本小部件。灵感来自于 Apple Music 中的歌词视图。
用法
FocusedTextWidget.fromString
// Example
FocusedTextWidget.fromString(
text: _text,
autoPlay: true,
autoPlayDuration: const Duration(seconds: 3),
)
// Using the fromString factory
factory FocusedTextWidget.fromString({
Key? key,
required String text,
String separator = '.',
int maxParagraphLines = 3,
bool showSeparator = false,
bool autoPlay = false,
double resizeFactor = 0.4,
Duration autoPlayDuration = const Duration(seconds: 5),
TextStyle? textStyle,
})
FocusedTextWidget.fromList
// Example
FocusedTextWidget.fromList(
textList: _textList,
),
// Using the fromList factory
factory FocusedTextWidget.fromList({
Key? key,
required List<String> textList,
int maxParagraphLines = 3,
bool autoPlay = false,
double resizeFactor = 0.4,
Duration autoPlayDuration = const Duration(seconds: 5),
TextStyle? textStyle,
})
抢先看
![]() |
![]() |
|---|

