Skip to content
devaryakjhaPublic

About

Native rich content runtime for flutter apps, with html rendering, trusted json documents, and live content patches

Topics

Resources

Contributing

Stars

21 stars

Watchers

1 watching

Forks

Repository files navigation

Tagflow

Tagflow

Native rich content runtime for Flutter apps, with HTML support through a first-party adapter.

Documentation · tagflow · tagflow_table


CI

Beta — 1.0.0-beta.1 adds Markdown, streaming and code block support to the native runtime. APIs may still change before 1.0.0.

What is this?

Tagflow used to be a Flutter HTML renderer. The beta line makes it a native rich content runtime.

Instead of forcing every dynamic screen through HTML, apps can render structured TagflowDocument content directly, accept trusted JSON from a backend or AI pipeline, validate it, render native Flutter widgets, and apply document patches for live content updates.

HTML still works through Tagflow.html(...), but it is now an adapter into the same runtime instead of the whole model.

Packages

  • tagflow - core runtime, HTML and Markdown adapters, native block transport, content policy, and rendering APIs
  • tagflow_table - first-party table extension for semantic TagflowDocument table nodes and legacy HTML table compatibility
  • examples/tagflow - feature gallery app and benchmark host
  • Seisei chat example - AI chat app that streams model answers into TagflowMarkdownStream and renders structured output as Tagflow documents

Gallery

The example app is a gallery of HTML, Markdown and native JSON input, live streaming, document patches, tables and the content policy, in light and dark themes.

Markdown rendered by Tagflow A simulated token stream rendered as it arrives Document patches that keep widget state Markdown in the dark theme

Install

dependencies:
  tagflow: ^1.0.0-beta.1

Add semantic table support when needed:

dependencies:
  tagflow: ^1.0.0-beta.1
  tagflow_table: ^1.0.0-beta.1

A caret constraint on a prerelease accepts every later prerelease, so flutter pub upgrade moves ^1.0.0-beta.0 apps onto beta.1. Production apps should pin exact versions (tagflow: 1.0.0-beta.1) and upgrade on purpose; see the changelog for upgrade notes.

Usage

Render HTML through the adapter entry point:

Tagflow.html(html: htmlContent);

Render Markdown, such as an AI answer, through the Markdown adapter:

Tagflow.markdown(markdown: answer);

Render a native document directly:

final document = TagflowDocument(
  id: 'article',
  children: [
    TagflowDocumentNode.paragraph(
      id: 'article.intro',
      children: [
        TagflowDocumentNode.text(
          id: 'article.intro.text',
          text: 'Native rich content for Flutter.',
        ),
      ],
    ),
  ],
);

Tagflow.document(document);

Use trusted app-controlled JSON without round-tripping through HTML:

const codec = TagflowNativeBlockCodec();
const adapter = TagflowNativeBlockAdapter();

final nativePayload = codec.decodeDocument(nativeJson);
final document = adapter.adapt(nativePayload);

Tagflow.document(document);

Patch envelopes decode through the same codec, adapt with TagflowNativeBlockAdapter.adaptPatches(...), and apply with TagflowDocument.applyPatches(...).

Stable Channel

0.0.8 remains the stable HTML-renderer line. The stable branch preserves that pre-native-runtime version for Git users.

main carries the native runtime prerelease line.

Development

dart pub get
dart run melos bootstrap
dart run melos run validate

Common commands:

dart run melos run analyze
dart run melos run test
dart run melos run format
dart run melos run publish:dry-run

Project Structure

packages/tagflow/             Core runtime and HTML adapter
packages/tagflow_table/       First-party table extension
packages/tagflow_benchmarks/  Parser, render and native-transport microbenchmarks
examples/tagflow/             Example app
docs/                         Specs and migration notes

Releases

Package publication is handled by GitHub Actions tag workflows:

  • tagflow-v* publishes packages/tagflow
  • tagflow_table-v* publishes packages/tagflow_table

Run dart run melos run publish:dry-run before cutting tags.

License

MIT

About

Native rich content runtime for flutter apps, with html rendering, trusted json documents, and live content patches

Topics

Resources

Contributing

Stars

21 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages