在 dart 中作为通用对象 return 类型的参数

function as parameter with generic object return type in dart

我有一个函数定义为

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

编译器在“Future”处显示编译错误:Expected to find '>'. 是否可以在 Dart 中将通用对象定义为定义为变量的函数的 return 类型。

这不是有效的语法。你的意思可能是:

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