Open omarsahl opened 1 year ago
Same issue here
There were various problems using plugins from isolates prior to Flutter 3.7, which aren't really an issue with this package but a limitation of flutter itself. Try updating to 3.7 or later and this should be resolved - see this excellent blogpost for a full explanation
Take particular note of the use of BackgroundIsolateBinaryMessenger.ensureInitialized(rootIsolateToken)
and also use DartPluginRegistrant.ensureInitialized()
and you should be good to go. I've been initialising timezones in flutter 3.7 in isolates and have no problems.
Hello @srawlins, thank you for the very helpful library.
I was trying to use flutter's
compute
function to move the initialization process to a new isolate using the following code:The problem is that the current implementation of
env.dart
uses a global variable forLocationDatabase
which doesn't work well with isolates, I believe.The second test of the following two tests fails and throws a
LocationNotFoundException
.