delay method

Future delay([
  1. FutureOr callback()?
])

Example:

print('📣 wait for 2.5 seconds');
await 2.5.delay();
print('✅ 2.5 seconds completed');
print('📣 callback in 1.8 seconds');
1.8.delay(() => print('✅ 1.8 seconds callback called'));
print('🎉 currently running callback');

Implementation

Future delay([FutureOr callback()?]) async => this.seconds.delay(callback);