agentleFS
mikezamayiasmikezamayias/agent-skills/skills/flutter-web-first-paint/SKILL.md

flutter-web-first-paint

Skill1 starsChanged 26 days agoBSD-3-ClauseView on GitHub

Speeds up Flutter web first paint with an HTML splash, deferred imports, first-screen preload and Wasm, not hosting. Use when deploying Flutter web (especially to Firebase Hosting) or when first load shows a blank screen. Also use when the CanvasKit download dominates time to interactive or when enabling Wasm.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Put a real splash in web/index.html with HTML/CSS (Flutter Gallery pattern).

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Flutter web first paint

CanvasKit is ~1.5MB. A blank body while main.dart.js downloads is a bug.

When Flutter web is the wrong tool

Flutter's web FAQ says Flutter is not suitable for static websites with text-rich, flow-based content such as blog articles, and that its web output "doesn't align with what search engines need to properly index" (https://docs.flutter.dev/platform-integration/web/faq, read 2026-11-01). The FAQ gives the reason as Flutter web prioritizing performance, fidelity and consistency for app-centric experiences. It does not say that drawing to a canvas is the cause, so do not give that as the reason. For static or document-like web content, the FAQ recommends either Jaspr, a community Dart package that builds a DOM-based site where SEO works as on a traditional website, or plain HTML for the landing, marketing and help pages next to a Flutter app. It says the Dart, Flutter documentation and Flutter marketing sites were migrated to Jaspr. Jaspr is MIT-licensed and supports server-side rendering and static generation (docs.jaspr.site, read 2026-10-30). The author of the Made in Dart site reports moving to Jaspr for server-rendered, indexable pages (single report, no benchmark). Decide this before tuning first paint for a public content or marketing site that must be indexed. Jaspr is third-party code, so any use, including dart pub add jaspr or dart pub global activate jaspr_cli, goes through the code-gate remote-code rule.

Splash

Put a real splash in web/index.html with HTML/CSS (Flutter Gallery pattern).

Don't block runApp

void main() {
  unawaited(warmCache());
  runApp(const MyApp());
}

unawaited work that mutates UI after dispose will throw. Gate on mounted or a repository.

Deferred imports

import 'settings.dart' deferred as settings;
Future<void> openSettings() async {
  await settings.loadLibrary();
  // push settings.SettingsPage()
}

Preload only first-screen assets

Serve WebP/AVIF for hero images.

<link rel="preload" href="assets/logo.webp" as="image" type="image/webp" />

Firebase Hosting:

"headers": [{
  "source": "/",
  "headers": [{ "key": "Link", "value": "<assets/logo.webp>; rel=preload; as=image" }]
}]

Preloading assets that aren't on the first screen wastes bandwidth.

Wasm

No dart:html / dart:js. Use package:web + dart:js_interop. Check every plugin is Wasm-ready (camera_web already is). flutter build web --wasm is opt-in and also emits a JS build that runs when the browser lacks WasmGC. Under Wasm, deferred imports are not split by default, and Wasm deferred loading (--enable-wasm-deferred-loading) is still experimental.

Optional: an HTML landing/login shell that loads instantly while flutter_bootstrap.js loads the app, then navigates in.

Sources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.