FlutterJS: I Built a Flutter Compiler That Outputs Real HTML (Not Canvas)

Published: (February 5, 2026 at 03:05 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

The Problem Nobody Talks About

Flutter Web has a secret: it’s not really “the web.”
When you build a Flutter Web app, everything renders to a “ element. That works for complex apps, but for websites it creates serious problems:

  • No SEO – Google can’t index canvas pixels
  • Huge bundles – 2–5 MB minimum, even for simple apps
  • Poor accessibility – No semantic HTML for screen readers
  • Slow first paint – 3–8 seconds to see content

I hit this wall when a client asked me to build a marketing site in Flutter. It looked great, but Google Search Console showed zero impressions. The site was invisible.

What If Flutter Compiled to Real HTML?

That’s what I built. FlutterJS takes your normal Flutter/Dart code:

Scaffold(
  appBar: AppBar(title: Text('My Site')),
  body: Center(
    child: Text('Hello, World!'),
  ),
)

and outputs semantic HTML:


  
## My Site

  
    
Hello, World!

  

How It Works

  • Write normal Flutter code – no special syntax required.
  • A Dart CLI analyzes your AST with full type resolution.
  • Generates JavaScript with a lightweight VNode runtime.
  • Outputs semantic HTML that search engines can index.
  • The JavaScript runtime handles diffing and updates, similar to React’s virtual DOM but optimized for Flutter’s widget model.

Metrics Comparison

MetricFlutter WebFlutterJS
Bundle Size2–5 MB50–100 KB
First Paint3–8 sNote: External pub.dev packages aren’t fully supported yet. Pure UI code works great.

Roadmap

  • Animations
  • Advanced Material widgets (Tabs, Dialog, BottomSheet)
  • Cupertino widgets
  • CustomPainter

The architecture already supports these; they just haven’t been implemented.

Getting Started

# Clone the repository
git clone --recursive https://github.com/flutterjsdev/flutterjs.git
cd flutterjs

# Activate the Dart CLI
dart pub global activate --source path .
dart pub get
dart run tool/init.dart

# Use the flutterjs commands
flutterjs --help

Open http://localhost:3000 and inspect the page—you’ll see real HTML elements.

  • Website:
  • GitHub:
  • pub.dev:

I Need Your Help

This is open source, and I’m looking for contributors. If you care about Flutter on the web:

  • Test it and report bugs
  • Contribute missing widgets
  • Help with documentation

What widgets would you need for your use case? Let me know in the comments.

Back to Blog

Related posts

Read more »

CSS Selectors 101

CSS Selectors – How to Target Elements You've written some HTML. Now you want to make it look good with CSS. But how do you tell CSS which elements to style? T...

HTML (The Skeleton)

!Cover image for HTML The Skeletonhttps://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.a...