代码拉取完成,页面将自动刷新
Add marquee_text as a dependency in your pubspec.yaml file.
dependencies:
marquee_text: ^2.5.0+1
Now in your flutter project, you can use:
Container(
width: 100,
color: Colors.green
child: Column(
children: [
/// horizontal marquee
MarqueeText(
text: TextSpan(
text: 'This is long long long text...',
),
style: TextStyle(
fontSize: 24,
color: Colors.white,
),
speed: 30,
),
/// vertical marquee
VerticalMarqueeText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: '''
This is long long long text...
This is long long long text...
This is long long long text...
''',
),
],
),
style: TextStyle(
fontSize: 24,
color: Colors.white,
),
speed: 30,
),
],
),
)
Property | Type | Required | Default |
---|---|---|---|
text | String | true | / |
style | TextStyle | false | / |
speed | double | false | 50 |
alwaysScroll | bool | false | false |
textDirection | TextDirection | false | TextDirection.ltr |
marqueeDirection | MarqueeDirection | false | MarqueeDirection.rtl |
textAlign | TextAlign | false | TextAlign.start |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。