delay static method

void delay(
  1. Duration duration,
  2. AsyncVoidTask task
)

Implementation

static void delay(Duration duration, AsyncVoidTask task) async{
  Future.delayed(duration, (){
    return task();
  });
}