FlowToken Flutter 🌊

Flutter port of FlowToken — smooth animations for streaming LLM text and markdown.

Try the interactive Flutter web demo at flowtoken-flutter.undivisible.dev.

Inspired by the original React library; uses gpt_markdown for static rendering.

Install

dependencies:
  flowtoken_flutter:
    git:
      url: https://github.com/undivisible/flowtoken_flutter
      ref: main

Usage

import 'package:flowtoken_flutter/flowtoken_flutter.dart';

// Streaming assistant reply
AnimatedMarkdown(
  content: streamBuffer,
  separator: FlowTokenSeparator.diff,
  animation: FlowTokenAnimation.fadeIn,
)

// Completed message — no animation
AnimatedMarkdown(
  content: message,
  animation: null,
)

Animations

fadeIn, blurIn, typewriter, slideInFromLeft, fadeAndScale, rotateIn, bounceIn, elastic, colorTransition, highlight, blurAndSharpen, dropIn, slideUp, wave

duration, curve, and animationIterationCount are available on AnimatedText, AnimatedMarkdown, and AnimatedImage. AnimatedMarkdown also preserves the upstream code-copy and image animation behavior.

License

ISC — see FlowToken for the original concept.

Libraries

flowtoken_flutter