FLUTTER ECOSYSTEM

peaashmeter/rich_typewriter

一個讓底層 Text.rich 或 RichText 像打字機一樣動畫的組件。

rich_typewriter 專案封面
Stars
2
Forks
1
最近推送(UTC)
2024年3月2日
專案狀態
未封存
Ivan Yuriev GitHub avatar
GITHUB User

Ivan Yuriev ↗

語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^3.0.1

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

rich_typewriter

A widget that makes underlying Text.rich or RichText animate like a typewriter.

Preview

Motivation

I was creating a visual novel engine, so I needed a convenient way to animate RichTexts (with styles and WidgetSpans). Actually there are some packages which do the thing, but they do not work with existent RichTexts and/or do not support WidgetSpans.

In addition, it's also a kind of proof of concept in terms of interaction with the element tree.

Features

  • Wrap a Text.rich or a RichText to animate.
  • Supports trees of InlineSpan with arbitrary depth.
  • Can print both text characters and widgets.
  • Allows to set up different delays for different symbols.
  • Allows to call a function when the animation ends.

Usage

RichTypewriter(
        child: const Text.rich(TextSpan(text: "some text", children: [
      WidgetSpan(
          child: FlutterLogo(
        size: 100,
      ))
    ])));