performRequest function
Implementation
Promise performRequest(String functionName, String jsonArgs) {
return Promise(js.allowInterop((resolve, reject) {
apiMethods[functionName]!(jsonDecode(jsonArgs)).then((response) {
final jsonString = jsonEncode(response.toJson());
resolve(jsonString);
}).catchError((error) {
reject(error);
});
}));
}