You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sounds like your closure is over-capturing, which is a known problem with the VM's implementation of closures.
Try moving the creation of the closure into another, function, say:
// Declared somewhere, top-level or static.Future<WhateverItIs> _computeExport(Map<String, String> data) =>compute((_) =>exportToForm(data), 'hi');
...
// Then use as:final result =await_computeExport(mapOfFields);
lrhn
added
the
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
label
Jun 9, 2023
lrhn
changed the title
Create an issue
Closures over-capture, cannot be sent to other isolate.
Jun 9, 2023
Hello! I'm trying to create a FormData from a Map<String, dynamic> but I'm faced with the error:
Very sorry, the only code I'm able to share is the following:
`final result = await compute((m)=>exportToFormData(mapOfFields), 'hi');
The function returns a Future.
I'm not able to share much more, but the case is very similar to this one(which has a code sample):
flutter/flutter#126520
The text was updated successfully, but these errors were encountered: