text
stringlengths 1
372
|
|---|
FlutterEngines but does remove the ability to spawn additional
|
FlutterEngines that share resources with existing spawned engines.
|
<topic_end>
|
<topic_start>
|
communication
|
communication between flutter instances is handled using platform channels
|
(or pigeon) through the host platform. to see our roadmap on communication,
|
or other planned work on enhancing multiple flutter instances, check out
|
issue 72009.
|
<topic_end>
|
<topic_start>
|
samples
|
you can find a sample demonstrating how to use FlutterEngineGroup
|
on both android and iOS on GitHub.
|
<topic_end>
|
<topic_start>
|
load sequence, performance, and memory
|
this page describes the breakdown of the steps involved
|
to show a flutter UI. knowing this, you can make better,
|
more informed decisions about when to pre-warm the flutter engine,
|
which operations are possible at which stage,
|
and the latency and memory costs of those operations.
|
<topic_end>
|
<topic_start>
|
loading flutter
|
android and iOS apps (the two supported platforms for
|
integrating into existing apps), full flutter apps,
|
and add-to-app patterns have a similar sequence of
|
conceptual loading steps when displaying the flutter UI.
|
<topic_end>
|
<topic_start>
|
finding the flutter resources
|
flutter’s engine runtime and your application’s compiled
|
dart code are both bundled as shared libraries on android
|
and iOS. the first step of loading flutter is to find those
|
resources in your .apk/.ipa/.app (along with other flutter
|
assets such as images, fonts, and JIT code, if applicable).
|
this happens when you construct a FlutterEngine for the
|
first time on both android
|
and iOS APIs.
|
<topic_end>
|
<topic_start>
|
loading the flutter library
|
after it’s found, the engine’s shared libraries are memory loaded
|
once per process.
|
on android, this also happens when the
|
FlutterEngine is constructed because the
|
JNI connectors need to reference the flutter c++ library.
|
on iOS, this happens when the
|
FlutterEngine is first run,
|
such as by running runWithEntrypoint:.
|
<topic_end>
|
<topic_start>
|
starting the dart VM
|
the dart runtime is responsible for managing dart memory and
|
concurrency for your dart code. in JIT mode,
|
it’s additionally responsible for compiling
|
the dart source code into machine code during runtime.
|
a single dart runtime exists per application session on
|
android and iOS.
|
a one-time dart VM start is done when constructing the
|
FlutterEngine for the first time on
|
android and when running a dart entrypoint
|
for the first time on iOS.
|
at this point, your dart code’s snapshot
|
is also loaded into memory from your application’s files.
|
this is a generic process that also occurs if you used the
|
dart SDK directly, without the flutter engine.
|
the dart VM never shuts down after it’s started.
|
<topic_end>
|
<topic_start>
|
creating and running a dart isolate
|
after the dart runtime is initialized,
|
the flutter engine’s usage of the dart
|
runtime is the next step.
|
this is done by starting a dart isolate in the dart runtime.
|
the isolate is dart’s container for memory and threads.
|
a number of auxiliary threads on the host platform are
|
also created at this point to support the isolate, such
|
as a thread for offloading GPU handling and another for image decoding.
|
one isolate exists per FlutterEngine instance, and multiple isolates
|
can be hosted by the same dart VM.
|
on android, this happens when you call
|
DartExecutor.executeDartEntrypoint()
|
on a FlutterEngine instance.
|
on iOS, this happens when you call runWithEntrypoint:
|
on a FlutterEngine.
|
at this point, your dart code’s selected entrypoint
|
(the main() function of your dart library’s main.dart file,
|
by default) is executed. if you called the
|
flutter function runApp() in your main() function,
|
then your flutter app or your library’s widget tree is also created
|
and built. if you need to prevent certain functionalities from executing
|
in your flutter code, then the AppLifecycleState.detached
|
enum value indicates that the FlutterEngine isn’t attached
|
to any UI components such as a FlutterViewController
|
on iOS or a FlutterActivity on android.
|
<topic_end>
|
<topic_start>
|
attaching a UI to the flutter engine
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.