FLUTTER ECOSYSTEM

zhcode66/flutter-marquee-text

一个允许文本自动滚动的 Flutter 小部件。

flutter-marquee-text 项目封面
Stars
14
Forks
12
最近推送(UTC)
2023年3月2日
项目状态
已归档
zhcode GitHub avatar
GITHUB User

zhcode ↗

Nothing!!!

China
语言DartSwiftKotlinObjective-C

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}
  • flutter_lints开发依赖^1.0.4

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

pub package

Screenshot

Screenshot

Usage

  1. Add marquee_text as a dependency in your pubspec.yaml file.

    dependencies:
      marquee_text: ^2.5.0+1
    
  2. 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,
          ),
        ],
      ),
    )
    

Properties

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