compute只能使用顶级功能,而不能使用实例或静态方法。
顶级函数是声明为不在类内部且不在另一个函数内的函数
List<DataModel> createDataList(String responFroJson) {...}class SomeClass { ... }应该修复它。
https://docs.flutter.io/flutter/foundation/compute.html
R是返回值的类型。callback参数必须是顶级函数,而不是类的闭包,实例或静态方法。

compute只能使用顶级功能,而不能使用实例或静态方法。
顶级函数是声明为不在类内部且不在另一个函数内的函数
List<DataModel> createDataList(String responFroJson) {...}class SomeClass { ... }应该修复它。
https://docs.flutter.io/flutter/foundation/compute.html
R是返回值的类型。callback参数必须是顶级函数,而不是类的闭包,实例或静态方法。