FLUTTER ECOSYSTEM

peaashmeter/rich_typewriter

Um widget que faz o Text.rich ou RichText subjacente animar como uma máquina de escrever.

Capa do projeto rich_typewriter
Stars
2
Forks
1
Último push (UTC)
2 de mar. de 2024
Status do projeto
Ativo
Ivan Yuriev GitHub avatar
GITHUB User

Ivan Yuriev ↗

LinguagensDart

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 3 itens
  • flutter{"sdk":"flutter"}
  • flutter_testDesenvolvimento{"sdk":"flutter"}
  • flutter_lintsDesenvolvimento^3.0.1

README original

Texto original em inglês. Visite o GitHub para a versão atual.

Expandir / recolher 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,
      ))
    ])));