Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The argument type 'FutureOr <dynamic> Function ... can't be assigned to the parameter type 'FutureOr <dynamic> Function #5

Open
stephane-couget opened this issue Nov 22, 2021 · 0 comments

Comments

@stephane-couget
Copy link

Hi, I am in the process of learning to use Parallel.run but I am running into a problem. I get the error:
Error: The argument type 'FutureOr <dynamic> Function ({int? Test})' can't be assigned to the parameter type 'FutureOr <dynamic> Function ({dynamic item})'.
Apart from the argument, the signature seems to be the same.

My idea is that clicking a button triggers a Parallel.run that works on a local database.

My Function:

FutureOr<dynamic> processWork ({int? Test} async { ... return 0; }

I call her in an ElevatedButton
ElevatedButton (
onPressed: oisvc.getExportJsonsToEmail,
...

and getExportJsonSToEmail is of the form
Future<void> getExportJsonsToEmail () async { final result = await Parallel.run ( processWork, // entryValue: 1, ); log ('result: $ result'); }

Whether I integrate the processWork function inside the static class or outside the class I always get a similar error.

I tested like the example void isOven by putting void processWork. And that's where my disappointments started.

Can you update the doc to use the static Parallel.run method to give a working example please?

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant