antiShake static method

dynamic antiShake(
  1. Function? doSomething, {
  2. dynamic durationTime = deFaultDurationTime,
})

Implementation

static antiShake(Function? doSomething,
    {durationTime = deFaultDurationTime}) {
  timer!.cancel();
  timer = new Timer(Duration(milliseconds: durationTime), () {
    doSomething!.call();
    timer = null;
  });
}