duration static method
ms as a Duration, or orElse when the knob is unset — never below
kMinEffectMs, so the result is always safe to drive an animation.
Implementation
static Duration duration(double? ms, Duration orElse) => animationSafe(
ms == null ? orElse : Duration(milliseconds: ms.round()));