Skip to content

devaryakjha/tagflow

Repository files navigation

tagflow

🌊 Tagflow Monorepo

codecov melos style: very good analysis

This is the monorepo for Tagflow, a native rich content runtime for Flutter apps. The 1.0.0-beta.x prerelease line makes TagflowDocument the primary runtime model, renders structured content with native Flutter widgets, and keeps HTML as a first-party adapter through TagflowHtmlAdapter and Tagflow.html(...).

The native-runtime line is intentionally breaking and prerelease-only. Do not promote it to beta or stable until the public API freeze review, benchmark evidence gates, package-owned route evidence, and release approval are reviewed and explicitly accepted.

📦 Packages

  • tagflow - Core runtime, HTML adapter, content policy, and rendering APIs
  • tagflow_table - Table rendering extension for Tagflow
  • examples - Example Flutter app showcasing Tagflow features

Beta Usage

Install the beta package:

dependencies:
  tagflow: ^1.0.0-beta.0

Render HTML through the adapter entry point:

Tagflow.html(html: htmlContent);

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);

Trusted app-controlled JSON can use the native block transport instead of 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(...).

Runtime interactions stay view-owned: use TagflowViewOptions.nodeTapCallback plus tapTargetKinds for tappable semantic nodes, while links continue to use linkTapCallback.

Parser, converter, selector, and legacy node APIs remain available during the alpha transition from package:tagflow/legacy.dart.

🛠️ Development

This project uses Melos for managing the monorepo.

Setup

  1. Install Melos:
dart pub global activate melos
  1. Bootstrap the workspace:
melos bootstrap

Common Tasks

# Run all tests
melos run test

# Clean build outputs
melos run build:clean

# Format code
melos run format

# Analyze code
melos run analyze

# Generate coverage report
melos run coverage

Release Prep

# Mutate package versions for the next alpha, then run publish validation
make release-alpha

# Validate the current publishable package metadata without publishing
make publish-dry-run

Do not publish from local release-prep branches. Actual package publication is handled by the package-specific GitHub Actions tag workflows.

🧪 Testing

We maintain high test coverage to ensure reliability:

  • Unit tests for core functionality
  • Widget tests for UI components
  • Integration tests for end-to-end flows

View our latest coverage report here.

👥 Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A flutter package that takes html string as input and parses and converts that to Flutter widgets based on the provided configuration.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors