designReduceMotionOf function

bool designReduceMotionOf(
  1. BuildContext context
)

Whether the reader asked for reduced motion at context: Android's Remove animations or the web's prefers-reduced-motion (MediaQuery.disableAnimationsOf), or iOS's Reduce Motion (dart:ui's AccessibilityFeatures.reduceMotion, which MediaQuery does not carry).

context builds again when either changes. A change of iOS's comes as a build, not as didChangeDependencies, so a State reads it in build or as it acts, not once in didChangeDependencies.

designReduceMotionOf(context) ? Duration.zero : const Duration(milliseconds: 200)

Implementation

bool designReduceMotionOf(BuildContext context) {
  // Both read, so [context] hears either change.
  final disabled = MediaQuery.maybeDisableAnimationsOf(context) ?? false;
  final reduced = _PlatformReduceMotion.of(context);
  return disabled || reduced;
}