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