Open variablevariance opened 2 years ago
HI @variablevariance, Thanks for filing the issue. RootBundle are not accessible in spawned isolates please see this line comments from the source code. https://github.com/flutter/flutter/blob/657830b4c77aecfd0e32ec6504c859213dded97a/examples/layers/services/isolate.dart#L132-L138
what I mean is that rootbundle should be accessible from spawned isolate in flutter.
This is done in the main isolate because spawned // isolates do not have access to the root bundle
I think this answers it that this is currently not possible. However I will leave this issue open for further insights from the team.
cc: @chinmaygarde
This is blocked on https://github.com/flutter/flutter/issues/13937
As #13937 is resolved, should be now able to access rootBundle from spawned isolates ?
@chinmaygarde is this now possible? Because as mentioned the blocking issue has been resolved.
Currently as of flutter 2.8.1, isolates cannot use rootBundle. I faced this issue and had to make a workaround for it but it introduces unnecessary code and looks ugly.
Example:
should be
//just call function like
compute(function,args);
I hope my example shows why rootBundle should be allowed in isolates.