Invalid argument(s): Illegal argument in isolate message : (object is a closure – Function ‘createDataList’:.)

compute can only take a top-level function, but not instance or static methods.

Top-level functions are functions declared not inside a class
and not inside another function

List<DataModel> createDataList(String responFroJson) {
...
}

class SomeClass { ... }

should fix it.

https://docs.flutter.io/flutter/foundation/compute.html

R is the type of the value returned. The callback argument must be a top-level function, not a closure or an instance or static method of a class.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)