delay method

dynamic delay({
  1. FutureOr onCompleted()?,
  2. bool days = false,
  3. bool hours = false,
  4. bool minutes = false,
  5. bool seconds = false,
  6. bool milliseconds = false,
  7. bool microseconds = false,
})

Implementation

delay(
    {FutureOr<dynamic> Function()? onCompleted,
    bool days = false,
    bool hours = false,
    bool minutes = false,
    bool seconds = false,
    bool milliseconds = false,
    bool microseconds = false}) {
  Future.delayed(
      Duration(
          days: days ? this : 0,
          seconds: seconds ? this : 0,
          milliseconds: milliseconds ? this : 0,
          minutes: minutes ? this : 0,
          hours: hours ? this : 0,
          microseconds: microseconds ? this : 0),
      onCompleted);
}