3
我收到以下错误。 The argument type 'dynamic' can't be assigned to the parameter type '() -> dynamic'
的示例是:镖强模式:匿名函数返回错误
outerFunc(somevar) {
return() {....}
}
anOtherFunction(func()) {....}
anOtherFunction(outerFunc('test'));
这些当我在analysis_options.yaml返回一个匿名函数,在强模式下发生。
strong-mode:
implicit-casts: false
添加自己的类型解决了这个问题'typedef的功能funcType();'然后使用它像'anOtherFunction(outerFunc( '测试' )as funcType);' – fredtma