performRequest function

Promise performRequest(
  1. String functionName,
  2. String jsonArgs
)

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);
    });
  }));
}