Home > Blockchain >  function as parameter with generic object return type in dart
function as parameter with generic object return type in dart

Time:05-06

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.

CodePudding user response:

That is not valid syntax. You probably meant:

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