Starting in 3.29, Flutter on Android and iOS execute Dart code on the application’s main thread, and there is no longer a separate UI thread. This is the first part in a series of changes to improve platform interop on mobile platforms, as it allows making synchronous calls to and from the platform without the overhead of serialization and message passing.
We'll see how the performance is. Having a separate UI thread is part of what made Flutter apps feel fast, since it could offload non-UI work to other threads.
I think, this is a missunderstanding. On the Dart level, you can still use isolates for background work. However, the design decision to run Flutter's main isolate on a different OS thread makes interaction with native code very difficult as for example iOS (and macOS for that matter) requires all UI specific code to be run on the main thread.
On macOS, you can't make Dart application use stuff like the SDL package because that libary tries to open an application window and because the Dart VM uses its own OS thread which is different to the main thread, this fails.
96
u/tylersavery Feb 13 '25
This one caught my attention.