withMinDuration method

Resolvable<T> withMinDuration(
  1. Duration? duration
)

Ensures that resolving this value takes at least a specified duration. If duration is null, this method returns the original value immediately.

Implementation

Resolvable<T> withMinDuration(Duration? duration) {
  if (duration == null) {
    return this;
  }
  return Async<Result<T>>(() async {
    return _withMinDuration(value, duration);
  }).flatten();
}