The only proposed fix (see https://github.com/flutter/flutter/issues/34993 thread in particular) for this issue that I could find is to ensure that the method runs on the main thread as requested. This pull request implements said fix.
Even though the invokeMethod calls are now always made on the main thread, the Node.js VM is still run on a separate thread and won't lock up the UI while JavaScript code is being evaluated.
This is a fix for issue https://github.com/j0j00/flutter_liquidcore/issues/5 and possibly also https://github.com/j0j00/flutter_liquidcore/issues/1.
Google introduced a new error with commit https://github.com/flutter/engine/commit/2c9e37c34e79475bbde7c8163eb5e56cdb9662a that causes plugins to throw if they are not run on the main thread when marked with
@UiThread
, which seems to be the problem with #5.The only proposed fix (see https://github.com/flutter/flutter/issues/34993 thread in particular) for this issue that I could find is to ensure that the method runs on the main thread as requested. This pull request implements said fix.
Even though the
invokeMethod
calls are now always made on the main thread, the Node.js VM is still run on a separate thread and won't lock up the UI while JavaScript code is being evaluated.