Solved: How flutter determine written code is for android or ios?

Question

Asked by Fasil K on December 29, 2021 (source).

Could anyone please explain behind the scenes of the flutter determines written code is for android or ios.

Answer

Question answered by prosach (source).

Dart is ahead-of-time (AOT) compiled into fast native X86 or ARM code for Android and iOS devices. Flutter can also call out to Android and use Android features only available in Java (same with iOS). Flutter is written in DART so we can't call that it compiles but DART does and it's rendering engine does.

enter image description here Flutter Framework provides all widgets and packages whereas Flutter SDK allows you to build apps for android and IOS

enter image description here

The engine’s C/C++code is compiled with Android’s NDK or iOS’ LLVM. Both pieces are wrapped in a “runner” Android and iOS project, resulting in an apk or ipa file respectively. On app launch, any rendering, input, or event is delegated to the compiled Flutter engine and app code.

enter image description here

I thought images would be much clear instead of writing many things.

More of these: https://docs.flutter.dev/resources/faq#run-android

ANDROID C++ DART FLUTTER IOS
SHARE: