To allow an instance of your Dart class to be called like a function.
Implement the call() method.
class ResponseObject {
call(String function, String status, dynamic data) {
return [function, status, data];
}
}
main() {
var response = new ResponseObject();
var data = {'Rock', 'Star'};
var result = response('Person', 'FETCHED SUCCESSFULLY', data);
print(result);
}