Does dart code of a different `@pragma(vm:entry-point)` runs in a separate isolate?

203 Views Asked by At

I have been working with Flutter and I have a doubt. I am trying to show overlay on top of my screen. That's why I am using flutter_overlay_window

In its example code I found this

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

@pragma("vm:entry-point")
void overlayMain() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(
    const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: TrueCallerOverlay(),
    ),
  );
}

main is the main entrypoint of dart VM's root isolate. But what about the overlayMain entry point?

How does the dart code inside of this entry point gets executed? In a new isolate or the same isolate?

Another question, will it be in the same flutter engine or different flutter engine.

I know the meaning of @pragma(vm:entry-point) notation.

These are additional readings I did. I have read a lot but didn't get any satisfactory answer

  1. dart vm
  2. dart executor
  3. Flutter engine
  4. Dart isolates

Please share any additional resources that I might have missed.

0

There are 0 best solutions below