'Flutter isolate blocks with poor internet connection

If the internet connection is poor, isolates are not working. I cannot send the ReceivePort to the isolate and do not reveive the sendPort back from the isolate. This does not occur in normal conditions but I only experience this with my Android tablets (Android 7 and 10) when I get shortly out of the range of the WiFi network so that the WiFi is not working anymore but the OS does not recognize the WiFi as "out of reach". If that happens the isolate blocks infinitely. Returning back to the WiFi-Network or getting completely out of reach of the WiFi does not help.

Also rootBundle.loadString() for ressources larger than 50kB is affected by the same behavior. The documentation says:

If the string is larger than 50 KB, the decoding process is delegated to an isolate to avoid jank on the main thread.

Since I did not find any other description of that issue I want to describe it here and hope that someone (maybe native speaking) can reproduce this and may point the flutter team to that issue. Seems only the flutter team can fix that.

In the meantime I cannot use isolate or rootBundle.loadString() anymore. For the latter I use rootBundle.load() instead.

Flutter 2.8.1 Dart 2.15.1



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source