除了移动设备外,Flutter 从同一代码库针对网页和桌面(Windows、macOS、Linux)进行开发——扩展了其 single-codebase 承诺。理解这些平台的能力和注意事项对于真正的 multi-platform 开发很有价值。
Flutter 的扩展平台支持
text
From ONE codebase, Flutter can target:
→ MOBILE (iOS, Android) — the original, most mature target
→ WEB — compiles Dart to JavaScript/WebAssembly; runs in the browser
→ DESKTOP — Windows, macOS, Linux native apps
→ The same widgets/code, more platforms — a compelling "write once, run everywhere" story.
网页注意事项
text
Flutter WEB renders the UI (CanvasKit/Skia or HTML) in the browser:
✓ great for app-like web experiences, internal tools, porting a Flutter app to web
✗ considerations: larger initial load, SEO limitations (content rendered on canvas),
not ideal for content/SEO-heavy public sites (vs traditional HTML/React for those)
→ best for web APPS, not content websites
