跪拜 Guibai
← All articles
Frontend · Flutter · Android

Flutter's Counter to Two Native Agents: Code Generation Is Cheap, Keeping Platforms Identical Is Not

By 恋猫de小郭 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Teams weighing Flutter against two AI-maintained native apps now have a concrete cost model to work with: generation is cheap, ongoing behavioral parity is not. Flutter's fast agent feedback loop is an attempt to keep that parity cost near zero, and it changes the default answer for small and medium teams.

Summary

Recently, both Shopify and the past two months of public discourse have argued that AI's ability to generate Swift and Kotlin cheaply makes Flutter's single-codebase bet obsolete: just point one agent at iOS and another at Android. Flutter's official answer is that this confuses the cost of first write with the cost of ownership. A single codebase carries code along with the accumulated history of product decisions and bug fixes; two agents can easily interpret one requirement in two different ways and land divergent behavior in two repositories. A checkout state machine example shows one platform discarding stale network responses while the other queues and reapplies them, with both sides passing local unit tests.

Flutter is therefore treating verification as the bottleneck. Stateful Hot Reload can run below 200ms, widget tests below 500ms, against 2 to 5 minutes for a native build, so an agent gets deterministic feedback on every edit and can try and fix more in the same time. On the infrastructure side, Flutter maintains 10 Flutter Skills and 14 Dart Skills, ships an MCP server, lets package authors publish skills with pub.dev dependencies, and connects analysis, tests, and runtime inspection into Codex, Claude Code, and Cursor. Native plugins remain slower, but that has become an asset: in the AI era, an unadapted plugin can be fixed by the agent directly rather than feared by the developer.

Takeaways
— Flutter's official defense of a single codebase rests on ongoing maintenance cost, not on the cost of first-time code generation.
— Two AI-maintained native implementations can both pass unit tests while behaving differently under retries, as in the checkout state machine example where one discards stale responses and the other queues them.
— Flutter Stateful Hot Reload can run below 200ms and widget tests below 500ms, compared with 2 to 5 minutes for traditional native builds.
— Flutter maintains 10 Flutter Skills and 14 Dart Skills, plus a `dart mcp-server`, to connect static analysis, test execution, and runtime checks into Codex, Claude Code, and Cursor.
— Package authors can publish Skills alongside pub.dev dependencies; developers run `dart run skills@ get` to discover rules for current dependencies.
— Flutter's AI ecosystem also includes A2UI, GenUI SDK for Flutter, and GenKit Agent SDK.
Conclusions

Framing AI cost as a verification problem rather than a generation problem changes which tools matter: the value now sits in sub-200ms reloads and fast widget tests, not in model output quality alone.

The checkout state machine example shows two agents can produce code that is locally correct and globally inconsistent. Keeping two AI-written native codebases aligned therefore costs more in specification and acceptance than in writing lines.

Native plugins used to be Flutter's weakest point because they required platform-specific knowledge; in this account, AI turns that weakness into a strength, since an agent can now edit the plugin directly.

Concepts & terms
MCP (Model Context Protocol)
An open protocol that lets AI assistants connect to external tools and data. Flutter's `dart mcp-server` exposes static analysis, test execution, and runtime checks to coding agents like Codex, Claude Code, and Cursor.
Flutter Skills / Dart Skills
Packages of instructions and rules that teach AI coding agents how to work with Flutter or Dart. The official set includes 10 Flutter Skills and 14 Dart Skills, and package authors can ship their own Skills with pub.dev dependencies.
Stateful Hot Reload
Flutter's Stateful Hot Reload updates running app state without a full restart. It can run in under 200ms, which gives AI agents near-immediate feedback after each edit.
Widget tests
Flutter tests that run a single widget in isolation and assert behavior. With sub-500ms runtimes, they serve as a fast verification gate for agent-generated UI changes.
From the discussion

Flutter's promise that one AI-maintained codebase outlasts two native ones runs into a hardware reality check: a native compile already adapts to a new device shape, while Flutter's latest tab bar still collides with the side status bar and its back button stays at the top. The economic calculus shifts in the AI era, where saving tokens matters more than saving headcount. A darker reading sees the end result as assembly-line engineering, with development oriented to AI rather than to human needs.

— Flutter still lags on current devices: the tab bar crosses the side status bar and the back button is stuck at the top, whereas a pure native build already handles the new iPhone Duo form factor.
— The scarce resource changes with the era: human labor was the cost in the manpower era, and token consumption is the cost in the AI era.
— AI-maintained software turns engineering into factory assembly-line work, a deskilling risk rather than an upgrade.
— Development becomes AI-facing: the stack is oriented toward AI, not toward the human developer.
Featured comments
小猴子Monkey

These days, a pure native Xcode 27.1 build is roughly all it takes to adapt to iPhone Duo, while Flutter's latest tab bar still cuts through the side status bar and the navigation bar's back button remains at the top.

茶树米

In the human era, save manpower; in the AI era, save tokens.

zhao1zhihui

It feels like, in the future, we'll be like assembly-line workers in an electronics factory.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗