cDelay method

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

Delays the execution of a callback or code by the specified duration.

Usage:

void main() {
  const delayDuration = Duration(seconds: 2);
  delayDuration.cDelay(() {
    // Code to be executed after a 2-second delay.
  });
}

Implementation

Future cDelay([FutureOr Function()? callback]) async =>
    Future.delayed(this, callback);