Flutter introduced flutter/flutter#150525 with version 3.29.
This means that Dart code is executed in the same thread as the platform channel (Java/Kotlin/Swift/ObjC code).
But implicitly this is true for all instances of FlutterEngine. For this plugin, which utilizes another FlutterEngine to spawn long living backgroud task in a foreground service, this means that the core functionality is compromised - running a new ForegroundTask will make it run in the same thread as the main Isolate, causing potential delays and stutters to ui, if anyone is doing any heavy lifting in the background (which is likely the main purpose of this plugin).
More details of this are being discussed flutter/flutter#169339 and in the upper issue. Currently the workaround is to opt-in to two flags - DisableMergedPlatformUIThread (and possibly EnablePlatformIsolates?). This will restore the previous state and FlutterEngine will continue to work as before - but these flags are bound to be deprecated at some point, at which this plugin will be potentially compromised and not have a workaround anymore.
Flutter introduced flutter/flutter#150525 with version 3.29.
This means that Dart code is executed in the same thread as the platform channel (Java/Kotlin/Swift/ObjC code).
But implicitly this is true for all instances of FlutterEngine. For this plugin, which utilizes another FlutterEngine to spawn long living backgroud task in a foreground service, this means that the core functionality is compromised - running a new ForegroundTask will make it run in the same thread as the main Isolate, causing potential delays and stutters to ui, if anyone is doing any heavy lifting in the background (which is likely the main purpose of this plugin).
More details of this are being discussed flutter/flutter#169339 and in the upper issue. Currently the workaround is to opt-in to two flags - DisableMergedPlatformUIThread (and possibly EnablePlatformIsolates?). This will restore the previous state and FlutterEngine will continue to work as before - but these flags are bound to be deprecated at some point, at which this plugin will be potentially compromised and not have a workaround anymore.