durationOf static method
Return the ambient AnimationDefaults.duration, or 200ms if there is no ambient AnimationDefaults or if the nearest AnimationDefaults has a null duration.
Implementation
static Duration durationOf(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<AnimationDefaults>()?.duration ?? const Duration(milliseconds: 200);
}