setInterval method

  1. @VoltronMethod(kFuncSetInterval)
bool setInterval(
  1. int interval,
  2. String callId,
  3. JSPromise promise
)

Implementation

@VoltronMethod(kFuncSetInterval)
bool setInterval(int interval, String callId, JSPromise promise) {
  var timer = TimerTask(interval, true, callId, (task) {
    promise.resolve("");
  });
  _timeInfo[callId] = timer;
  timer.start();
  return true;
}