sendResults method

void sendResults(
  1. List<String> results,
  2. int id
)

send string list result to dapp

Implementation

void sendResults(List<String> results, int id) {
  final array = results
      .map((e) => e.toLowerCase())
      .toList()
      .map((e) => "\"$e\"")
      .toList();
  final arrayStr = array.join(",");
  final script = "window.ethereum.sendResponse($id, [$arrayStr])";
  evaluateJavascript(source: script);
}