<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rakibul Hasan</title>
    <description>The latest articles on DEV Community by Rakibul Hasan (@101rakibulhasan).</description>
    <link>https://dev.to/101rakibulhasan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1232786%2Fdc964c1d-82f1-4443-8062-c46a4869193c.jpeg</url>
      <title>DEV Community: Rakibul Hasan</title>
      <link>https://dev.to/101rakibulhasan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/101rakibulhasan"/>
    <language>en</language>
    <item>
      <title>How we made a 185-page Flutter web app readable by Google and AI crawlers</title>
      <dc:creator>Rakibul Hasan</dc:creator>
      <pubDate>Tue, 24 Nov 2026 10:10:34 +0000</pubDate>
      <link>https://dev.to/101rakibulhasan/how-we-made-a-185-page-flutter-web-app-readable-by-google-and-ai-crawlers-nmo</link>
      <guid>https://dev.to/101rakibulhasan/how-we-made-a-185-page-flutter-web-app-readable-by-google-and-ai-crawlers-nmo</guid>
      <description>&lt;p&gt;Flutter web draws your app onto a canvas. That is great for users and terrible for crawlers: a fresh &lt;code&gt;flutter build web&lt;/code&gt; hands Google a page with almost no text, no headings and the same title on every route.&lt;/p&gt;

&lt;p&gt;We run &lt;a href="https://www.typeordrop.com" rel="noopener noreferrer"&gt;TypeorDrop&lt;/a&gt;, a free file-tools site (PDF, Word, image, audio and video converters) built entirely in Flutter web. It has 185 public URLs. This is how we made every one of them readable without server-side rendering, headless Chrome, or changing a single widget, and what crawlers actually did afterwards.&lt;/p&gt;

&lt;p&gt;The generic tooling is open source: &lt;strong&gt;&lt;a href="https://github.com/nexina/flutter-web-seo" rel="noopener noreferrer"&gt;nexina/flutter-web-seo&lt;/a&gt;&lt;/strong&gt; (MIT, Python, no dependencies).&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: one static HTML shell per route
&lt;/h2&gt;

&lt;p&gt;At deploy time, after &lt;code&gt;flutter build web&lt;/code&gt;, a script takes the built &lt;code&gt;index.html&lt;/code&gt; as a template and writes one copy per route, for example &lt;code&gt;/merge-docx/index.html&lt;/code&gt;. Each copy gets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;its own &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt;, meta description, canonical URL, Open Graph and Twitter tags&lt;/li&gt;
&lt;li&gt;JSON-LD: &lt;code&gt;SoftwareApplication&lt;/code&gt;, &lt;code&gt;BreadcrumbList&lt;/code&gt;, &lt;code&gt;FAQPage&lt;/code&gt; where there is an FAQ&lt;/li&gt;
&lt;li&gt;the page's real text (H1, intro, how-to steps, features, FAQ, related links) inside a &lt;code&gt;#seo-content&lt;/code&gt; block&lt;/li&gt;
&lt;li&gt;the same Flutter bootstrap as before, so users get the full app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The server serves &lt;code&gt;/merge-docx&lt;/code&gt; straight from &lt;code&gt;/merge-docx/index.html&lt;/code&gt;. A crawler that runs no JavaScript sees a normal document. A user sees Flutter.&lt;/p&gt;

&lt;p&gt;On our Merge Word page, a crawler without JavaScript now sees &lt;strong&gt;1,104 words&lt;/strong&gt; of real content, where it used to see the default Flutter shell.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hide it the right way
&lt;/h3&gt;

&lt;p&gt;The text block must not be &lt;code&gt;display: none&lt;/code&gt;. We clip it to 1 px (a &lt;code&gt;visually-hidden&lt;/code&gt; class), keep it in the DOM next to the Flutter host, and never remove it when Flutter mounts. Screen readers can still reach it, and it shows the same content the app shows, so it is not cloaking. A &lt;code&gt;&amp;lt;noscript&amp;gt;&lt;/code&gt; rule reveals it fully, and if Flutter has not booted after 20 seconds, the page shows it as a plain fallback.&lt;/p&gt;

&lt;h3&gt;
  
  
  The content comes from data, not templates
&lt;/h3&gt;

&lt;p&gt;Our shells are generated from the same database rows the app uses (title, H1, intro, steps, FAQ per tool), plus Markdown for blog posts. Change a row, redeploy, and the page and the app agree. The build stops on mistakes: titles over 60 characters, descriptions outside 120 to 160 characters, duplicate titles, a sitemap URL without a page file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The server side matters as much as the HTML
&lt;/h2&gt;

&lt;p&gt;Most Flutter SEO packages stop at the HTML. Half our problems were in nginx:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Trailing slashes.&lt;/strong&gt; &lt;code&gt;/convert-pdf-to-word&lt;/code&gt; and &lt;code&gt;/convert-pdf-to-word/&lt;/code&gt; were both indexed and ranked 12 positions apart. Now every &lt;code&gt;/x/&lt;/code&gt; gets a permanent 301 to &lt;code&gt;/x&lt;/code&gt; in one hop, and &lt;code&gt;http&lt;/code&gt;, apex and slash variants all reach the final URL in a single redirect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Serve the shell without nginx's own redirect.&lt;/strong&gt; &lt;code&gt;try_files $uri $uri/index.html @app;&lt;/code&gt; serves &lt;code&gt;/x&lt;/code&gt; from &lt;code&gt;/x/index.html&lt;/code&gt; internally, so nginx never answers with its own 301 to &lt;code&gt;/x/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real 404s.&lt;/strong&gt; A single-page app normally answers every path with &lt;code&gt;index.html&lt;/code&gt; and status 200, so Google indexes junk URLs. We keep a generated list of known app routes; anything else gets a real 404.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;noindex&lt;/code&gt; on code.&lt;/strong&gt; &lt;code&gt;*.js&lt;/code&gt;, &lt;code&gt;*.mjs&lt;/code&gt;, &lt;code&gt;*.wasm&lt;/code&gt; and &lt;code&gt;*.json&lt;/code&gt; get &lt;code&gt;X-Robots-Tag: noindex&lt;/code&gt;. Crawlers can still fetch them to render, but they don't show up as pages.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The repo includes an example nginx config with all four.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sitemap, lastmod and IndexNow
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;lastmod&amp;gt;&lt;/code&gt; comes from real change dates (the database row's &lt;code&gt;updated_at&lt;/code&gt;, or the git date of the source file), never "today". A sitemap where everything changed today teaches Google to ignore your dates.&lt;/li&gt;
&lt;li&gt;Every sitemap URL must return 200 directly, with no redirect, no trailing slash and no query string. We check all 185 on every deploy.&lt;/li&gt;
&lt;li&gt;After each deploy we post the sitemap to IndexNow, which Bing, Yandex and others pick up within minutes.&lt;/li&gt;
&lt;li&gt;We also publish an &lt;code&gt;llms.txt&lt;/code&gt; so AI assistants get a short, accurate description of the site.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What crawlers did
&lt;/h2&gt;

&lt;p&gt;From our nginx logs for one week (14 to 21 November 2026), counting requests by user agent:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Crawler&lt;/th&gt;
&lt;th&gt;Requests&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Googlebot&lt;/td&gt;
&lt;td&gt;717&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bingbot&lt;/td&gt;
&lt;td&gt;193&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ClaudeBot&lt;/td&gt;
&lt;td&gt;142&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OAI-SearchBot&lt;/td&gt;
&lt;td&gt;97&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ChatGPT-User&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPTBot&lt;/td&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;ChatGPT-User&lt;/code&gt; is a person's ChatGPT fetching one of our pages to answer a question, in real time. That only works if the page has text in its HTML. A canvas-only Flutter page gives the assistant nothing to quote.&lt;/p&gt;

&lt;p&gt;One trap: &lt;code&gt;Google-Extended&lt;/code&gt; is a robots.txt token, not a user agent. It never appears in logs, so a zero there means nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: making Flutter web fast enough to rank
&lt;/h2&gt;

&lt;p&gt;Readable HTML is half the job; Core Web Vitals are the other half. Our mobile PageSpeed score was 60, with 9.9 seconds of Total Blocking Time. Flutter's multi-threaded web renderer needs cross-origin isolation, so we sent two headers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nc"&gt;Cross&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Origin&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Opener&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Policy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;same&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;origin&lt;/span&gt;
&lt;span class="nc"&gt;Cross&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Origin&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Embedder&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Policy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;credentialless&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mobile TBT dropped to &lt;strong&gt;0.2 s&lt;/strong&gt; and the home page scored &lt;strong&gt;89&lt;/strong&gt;. Browsers without support fall back to the single-threaded renderer automatically. &lt;code&gt;credentialless&lt;/code&gt; matters if you load third-party iframes: &lt;code&gt;require-corp&lt;/code&gt; would break most of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do you need this?
&lt;/h2&gt;

&lt;p&gt;Probably not if your app sits behind a login: nothing crawls it. If your Flutter web app has public pages that should be found, you have options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://pub.dev/packages/seo" rel="noopener noreferrer"&gt;&lt;code&gt;seo&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://pub.dev/packages/esen_seo" rel="noopener noreferrer"&gt;&lt;code&gt;esen_seo&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://pub.dev/packages/hydraline_flutter" rel="noopener noreferrer"&gt;&lt;code&gt;hydraline&lt;/code&gt;&lt;/a&gt; build HTML from your widget tree in Dart.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pub.dev/packages/flutter_prerender" rel="noopener noreferrer"&gt;&lt;code&gt;flutter_prerender&lt;/code&gt;&lt;/a&gt; renders each route in headless Chrome.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/nexina/flutter-web-seo" rel="noopener noreferrer"&gt;&lt;code&gt;flutter-web-seo&lt;/code&gt;&lt;/a&gt; (ours) is the data-driven option: a small Python CLI that writes shells from a JSON route config, with no Dart dependency, no widget changes and no browser, plus the nginx rules and validation above.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pick the one that matches where your content lives. Ours lives in a database, so generating shells from data was the simplest thing that could work, and it has run in production on every deploy since October.&lt;/p&gt;

&lt;p&gt;If you try it, issues and pull requests are welcome.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>seo</category>
      <category>webdev</category>
      <category>nginx</category>
    </item>
    <item>
      <title>How I got a Flutter web app (CanvasKit) indexed by Google with static SEO shells</title>
      <dc:creator>Rakibul Hasan</dc:creator>
      <pubDate>Thu, 29 Oct 2026 13:18:55 +0000</pubDate>
      <link>https://dev.to/101rakibulhasan/how-i-got-a-flutter-web-app-canvaskit-indexed-by-google-with-static-seo-shells-315d</link>
      <guid>https://dev.to/101rakibulhasan/how-i-got-a-flutter-web-app-canvaskit-indexed-by-google-with-static-seo-shells-315d</guid>
      <description>&lt;p&gt;Flutter web is great for building an app once and shipping it everywhere. It's not great for SEO.&lt;/p&gt;

&lt;p&gt;With the CanvasKit renderer, everything is drawn onto a &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;. If you open "view source" on a Flutter web page, all you get is a nearly empty &lt;code&gt;index.html&lt;/code&gt; and a script tag. Google can render JavaScript, but rendering is queued and slow on a large app. Many other crawlers and the link preview bots (WhatsApp, Facebook, X) don't run it at all.&lt;/p&gt;

&lt;p&gt;I ran into this building &lt;a href="https://www.typeordrop.com/?utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;TypeorDrop&lt;/a&gt;, a free online file converter. It has 150 tool pages, like &lt;code&gt;/convert-jpg-to-pdf&lt;/code&gt; or &lt;code&gt;/merge-pdf&lt;/code&gt;. Every one of them needs its own title, description and indexable text, or it will never rank.&lt;/p&gt;

&lt;p&gt;There are packages for this (&lt;code&gt;flutter_prerender&lt;/code&gt;, &lt;code&gt;esen_seo&lt;/code&gt;) and paid prerender services. I wanted the SEO text to come from the same database column the app already renders, with no new dependency in the Flutter app, so I wrote a small build step instead: &lt;strong&gt;static SEO shells&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;

&lt;p&gt;A shell is a copy of Flutter's built &lt;code&gt;index.html&lt;/code&gt;, generated at deploy time, one per route. Each copy gets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a unique &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt;, meta description and &lt;code&gt;&amp;lt;link rel="canonical"&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open Graph and Twitter card tags&lt;/li&gt;
&lt;li&gt;JSON-LD: &lt;code&gt;SoftwareApplication&lt;/code&gt;, plus &lt;code&gt;FAQPage&lt;/code&gt; when the tool has FAQ items&lt;/li&gt;
&lt;li&gt;real body text: H1, intro, how-to steps, features, supported input and output formats, FAQ, related tools and related articles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Flutter bootstrap stays the same. A crawler reads the HTML. A person's browser loads Flutter, which draws the app on top. The same URL serves the same HTML to everyone. Nothing switches on user agent, which would be cloaking.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;build/web/
├── index.html                    ← homepage shell
├── convert-jpg-to-pdf/index.html ← shell for /convert-jpg-to-pdf
├── merge-pdf/index.html
├── ...
├── main.dart.js                  ← shared by every shell
└── sitemap.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  One source of truth for the text
&lt;/h2&gt;

&lt;p&gt;The most important rule: &lt;strong&gt;the shell text should match what users see&lt;/strong&gt;. If the hidden HTML says one thing and the app shows another, you're asking for trouble with search engines.&lt;/p&gt;

&lt;p&gt;So the text doesn't live in the generator. Each tool row in the database has an &lt;code&gt;seo&lt;/code&gt; JSON column (h1, intro, steps, features, FAQ, related tools). The API returns that column to the Flutter tool page, which renders the how-it-works, features, formats and FAQ sections from it. At deploy time, the same column is exported to a temporary JSON file and the generator reads it. When I edit a FAQ answer, the app and the shell both change on the next deploy.&lt;/p&gt;

&lt;p&gt;The pricing shell and the homepage's popular-tools list go one step further: the generator reads them from the same Dart constants the app uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  The generator (simplified)
&lt;/h2&gt;

&lt;p&gt;The real script is longer and has tests (77 across the SEO and blog generators, all offline with mocked HTTP). This is the shape of it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# runs after `flutter build web --release`
# tools = JSON export of active web tools, including the seo column
&lt;/span&gt;&lt;span class="n"&gt;TEMPLATE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;build/web/index.html&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;            &lt;span class="c1"&gt;# e.g. "convert-jpg-to-pdf"
&lt;/span&gt;    &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;stamp_head&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TEMPLATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;canonical&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# replaces &amp;lt;title&amp;gt; + meta description; adds og:*, twitter:* and
&lt;/span&gt;    &lt;span class="c1"&gt;# &amp;lt;link rel="canonical"&amp;gt; just before &amp;lt;/head&amp;gt;
&lt;/span&gt;
    &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;replace_seo_block&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;seo_block&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="c1"&gt;# fills the &amp;lt;div id="seo-content" class="visually-hidden"&amp;gt; placeholder
&lt;/span&gt;    &lt;span class="c1"&gt;# (outside the Flutter host element): h1, intro, how-to &amp;lt;ol&amp;gt;, features,
&lt;/span&gt;    &lt;span class="c1"&gt;# formats, FAQ, related tools/articles + SoftwareApplication &amp;amp; FAQPage JSON-LD
&lt;/span&gt;
    &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;replace_footer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;              &lt;span class="c1"&gt;# plain-HTML footer with real links
&lt;/span&gt;    &lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;build/web/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/index.html&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# then: sitemap.xml (lastmod = each tool's updated_at), robots.txt,
# and the homepage shell (Organization, WebSite, ItemList of popular tools)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few rules live in the generator too: titles stay at 60 characters or less with the brand last, descriptions land between 120 and 160 characters, and duplicate titles or descriptions print a warning.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that makes it work: keep Flutter out of &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;By default, Flutter takes over &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; and your shell content ends up under the canvas or gone. I use a custom &lt;code&gt;flutter_bootstrap.js&lt;/code&gt; that mounts Flutter into a dedicated element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;_flutter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;loader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;onEntrypointLoaded&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;engineInitializer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appRunner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;engineInitializer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initializeEngine&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;hostElement&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#flutter-host&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;appRunner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;runApp&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;#seo-content&lt;/code&gt; block sits outside &lt;code&gt;#flutter-host&lt;/code&gt;, and nothing removes it after boot. It's hidden with a standard visually-hidden class, not &lt;code&gt;display:none&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.visually-hidden&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-1px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;clip&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;rect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;nowrap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two fallbacks come almost free:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No JavaScript:&lt;/strong&gt; a &lt;code&gt;&amp;lt;noscript&amp;gt;&lt;/code&gt; style block turns the shell into a normal visible page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flutter fails to load:&lt;/strong&gt; if the app hasn't painted after 20 seconds, the static page is shown instead of a blank screen.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also make sure &lt;code&gt;&amp;lt;base href="/"&amp;gt;&lt;/code&gt; is set. Otherwise &lt;code&gt;/convert-jpg-to-pdf/index.html&lt;/code&gt; looks for &lt;code&gt;main.dart.js&lt;/code&gt; inside its own folder and the app never boots.&lt;/p&gt;

&lt;h2&gt;
  
  
  Serving it with nginx
&lt;/h2&gt;

&lt;p&gt;Canonical URLs have no trailing slash, so &lt;code&gt;/convert-jpg-to-pdf&lt;/code&gt; must return the shell with a 200, not a redirect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;# /convert-jpg-to-pdf -&amp;gt; convert-jpg-to-pdf/index.html, 200, no redirect&lt;/span&gt;
    &lt;span class="kn"&gt;try_files&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt;&lt;span class="n"&gt;/index.html&lt;/span&gt; &lt;span class="n"&gt;/index.html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;add_header&lt;/span&gt; &lt;span class="s"&gt;Cache-Control&lt;/span&gt; &lt;span class="s"&gt;"no-cache"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The detail that matters is &lt;code&gt;$uri/index.html&lt;/code&gt; instead of &lt;code&gt;$uri/&lt;/code&gt;. With &lt;code&gt;$uri/&lt;/code&gt;, nginx adds its own trailing-slash redirect. I also 301 &lt;code&gt;/x/&lt;/code&gt; to &lt;code&gt;/x&lt;/code&gt;, so the two rules together would loop. With &lt;code&gt;$uri/index.html&lt;/code&gt;, there's no loop.&lt;/p&gt;

&lt;p&gt;HTML is served &lt;code&gt;no-cache&lt;/code&gt;, and each build ID is added to the URLs of &lt;code&gt;main.dart.js&lt;/code&gt;, &lt;code&gt;flutter_bootstrap.js&lt;/code&gt; and the service worker, so a deploy never leaves people on a stale app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things around the shells that helped
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sitemap from the same data.&lt;/strong&gt; The generator writes &lt;code&gt;sitemap.xml&lt;/code&gt; from the same tool list, and the blog and static page generators add their URLs. A tool can't be live and missing from the sitemap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean removals.&lt;/strong&gt; Every build starts from an empty folder, and the upload to the server deletes files that are no longer there, so a removed tool's page disappears. Routes I discontinued return &lt;code&gt;410 Gone&lt;/code&gt;, so search engines drop them fast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IndexNow after deploy.&lt;/strong&gt; When all post-deploy checks pass, the script POSTs every sitemap URL to &lt;code&gt;api.indexnow.org&lt;/code&gt;. Bing and others pick up changes without waiting for a recrawl.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Noindex the API host.&lt;/strong&gt; My API subdomain had started showing up in search results. A &lt;code&gt;robots.txt&lt;/code&gt; on it plus &lt;code&gt;X-Robots-Tag: noindex, nofollow&lt;/code&gt; fixed that. The tools endpoint stays allowed, because Googlebot needs it to render the real pages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plain HTML for articles.&lt;/strong&gt; Blog posts are fully static pages generated from Markdown. Flutter is the wrong tool for article pages. The deploy script fails if a post accidentally includes the Flutter bootstrap.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I'd still improve
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Soft 404s.&lt;/strong&gt; Unknown URLs fall back to &lt;code&gt;/index.html&lt;/code&gt; with a 200, so a mistyped URL gets the homepage instead of a real 404. Blog URLs already return real 404s.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;og:image on tool pages.&lt;/strong&gt; Link previews show the right title and description, but tool shells don't have their own preview image yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results so far
&lt;/h2&gt;

&lt;p&gt;Before shells, every URL returned the same empty document with the same title, and Search Console showed little beyond the homepage. Now tool pages get indexed on their own, each with its own title and description in results, and chat link previews show the right page.&lt;/p&gt;

&lt;p&gt;The site is young, so rankings are moving slowly. But the "Google can't see my Flutter app" problem is solved, and it needed no SSR, no second frontend and no new Flutter package.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this approach is enough
&lt;/h2&gt;

&lt;p&gt;Static shells work well when your public pages are &lt;strong&gt;known at build time&lt;/strong&gt;: tool pages, landing pages, docs. If you have millions of user-generated pages, you need real server rendering or a prerender service.&lt;/p&gt;

&lt;p&gt;If you're shipping a Flutter web app and wondering why nobody finds it, open "view source" on a few of your URLs. If they all look the same, that's your problem.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I build &lt;a href="https://www.typeordrop.com/?utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;TypeorDrop&lt;/a&gt;: free file conversion, PDF and image tools in the browser, built with Flutter web, FastAPI and Celery. Questions about the setup are welcome in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>seo</category>
      <category>webdev</category>
      <category>python</category>
    </item>
  </channel>
</rss>
