delayed static method

Future<void> delayed(
  1. int milliseconds,
  2. VoidCallback callback
)

DO THAT:

Future.delayed(
 Duration(milliseconds: milliseconds),
 () => callback(),
);

Implementation

static Future<void> delayed(
  int milliseconds,
  VoidCallback callback,
) async {
  await Future.delayed(
    Duration(milliseconds: milliseconds),
    () => callback(),
  );
}