Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of functions with defined signature in Dart

Tags:

dart

In Dart, is it possible to have a list of functions that have a well defined signature? I'm looking for something like

List<(int, int) -> int> listOfFunctions;

which is of course wrong.

I can do

List<Function> listOfFunctions;

but then I don't know the signature.

Thanks for any hints.

like image 598
zegkljan Avatar asked Aug 25 '15 07:08

zegkljan


1 Answers

Just create a typedef for your function

typedef int MyFunction(int a, int b);

List<MyFunction> listOfFunctions;
like image 161
Günter Zöchbauer Avatar answered Sep 18 '22 12:09

Günter Zöchbauer