Say I need a function passed into a method which takes a String and turns it into a double:
void strToDouble(String input, Function converter) {
print('As a double, $input is ${converter(input)}`);
}
(Obviously toy example)
How can I declare the type of converter
as a function that turns a String
to double?