Skip to content

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

@stephane-couget

Description

@stephane-couget

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions