function as parameter with generic object return type in dart

Viewed 356

I have a function defined as

final Function<Future<PageableModel<T>>>(String?) elementBuilder;

The compiler shows a compile error at "Future": Expected to find '>'. Is it possible in Dart to define a generic object as the return type of a function defined as variable.

1 Answers

That is not valid syntax. You probably meant:

final Future<PageableModel<T>> Function(String?) elementBuilder;
Related