Flutter - How does it work behind the scenes?

前端 未结 3 450
灰色年华
灰色年华 2020-12-24 01:55

Obviously, flutter is a framework for running apps on iOS and Android using one codebase. But how does it manage to do so? Will it compile to nativ

3条回答
  •  -上瘾入骨i
    2020-12-24 02:32

    The Dart source code is compiled to native code using Dart's AoT compilation feature. It still needs parts of the the Dart VM (some runtime components like garbage collection) to run though, but the code is compiled to native code ahead of time, because iOS doesn't allow dynamic compilation.

    Flutter can also call out to Android and use Android features only available in Java (same with iOS). Flutter supports to build custom plugins (in addition to a lot of provided ones) to call out to native platform code.

提交回复
热议问题