You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter前身Sky的网络加载Dart代码特性现状及无应用商店更新可行性问询

Flutter动态加载Dart代码的现状解析

Great question! It’s fascinating to look back at Flutter’s early Sky origins and how the framework has evolved since that initial demo. Let’s break down your question clearly:

Context: Sky vs. Modern Flutter

Back when Flutter was still called Sky, the team experimented with dynamic code loading as a core pillar—hence Eric Seidel’s comment about loading all content (including Dart code) over the network. But as Flutter matured to target mobile, desktop, and web at scale, priorities shifted heavily toward performance and platform compliance, which reshaped how dynamic code execution works.

Can You Load New Dart Code Over the Network Without App Store Approval?

The short answer is: Not officially, and not without violating major app platform policies in most cases. Here’s the detailed breakdown:

  • Flutter’s Default Production Compilation: Modern Flutter uses AOT (Ahead-of-Time) compilation for production builds. This compiles Dart code directly to native machine code, delivering the smooth, native-like performance users expect—but it also means the app’s code is static once installed. You can’t dynamically load and execute new Dart code at runtime with standard AOT builds.
  • JIT Compilation Limitations: While Dart supports JIT (Just-in-Time) compilation (used for Flutter’s hot reload during development), enabling JIT in production is not officially supported. Even if you could work around this to load remote Dart code, both Apple’s App Store and Google Play have strict rules against it:

    Apple explicitly prohibits apps that download and execute compiled code dynamically, except for narrow use cases like JavaScript in a web view (which is interpreted, not compiled to native code).
    Google Play allows limited dynamic code loading but only for interpreted languages (again, like JS) and requires full disclosure—loading compiled Dart code would likely violate their policies.

  • Compliant Workarounds:
    • Remote Configuration & Feature Flags: Instead of loading full code, you can use tools like Firebase Remote Config or custom backend APIs to toggle features, adjust UI behavior, or fetch business logic rules. This is fully compliant and widely used in production.
    • Modular Architecture: Split your app into feature modules that can be conditionally loaded, but this still requires including all modules in the initial app bundle (no post-install code addition).
    • Dart FFI: You can load native C/C++ libraries over the network using dart:ffi, but this doesn’t apply to Dart code itself.

Why the Shift From Sky’s Original Vision?

Sky’s early focus was on lightweight, web-like flexibility for embedded devices. As Flutter expanded to mainstream platforms, performance and app store compliance became non-negotiable. AOT compilation delivers the consistent speed users demand, and aligning with platform policies ensures apps can be distributed to global audiences without rejection.

内容的提问来源于stack exchange,提问作者GreenTigerEye

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:38:20