Epic: #170
Depends on: 0.4.3 shipped
Source: docs/motion-and-high-refresh.md §4
Goal
Introduce lib/core/motion/ as the single source of truth for animation durations and curves across the app.
Files
lib/core/motion/querya_motion.dart (new)
lib/core/motion/motion_scope.dart or extension on BuildContext (new)
test/core/motion/querya_motion_test.dart (new)
Implementation
- Duration tokens:
instant (0 ms), fast (120 ms), standard (200 ms), slow (320 ms).
- Curve tokens:
enter (easeOutCubic), exit (easeInCubic), standard (easeInOutCubic), emphasized (easeInOutCubicEmphasized).
- Helper
effectiveDuration(BuildContext, Duration) that reads MediaQuery.disableAnimationsOf(context) and returns instant when OS reduce-motion is on (A5 will add in-app override later; design API now).
- Export from a small barrel if needed; no widget changes in this issue.
Acceptance Criteria
Tests
- Token constants match design doc values.
effectiveDuration with/without MediaQuery.disableAnimations.
Epic: #170
Depends on: 0.4.3 shipped
Source:
docs/motion-and-high-refresh.md§4Goal
Introduce
lib/core/motion/as the single source of truth for animation durations and curves across the app.Files
lib/core/motion/querya_motion.dart(new)lib/core/motion/motion_scope.dartor extension onBuildContext(new)test/core/motion/querya_motion_test.dart(new)Implementation
instant(0 ms),fast(120 ms),standard(200 ms),slow(320 ms).enter(easeOutCubic),exit(easeInCubic),standard(easeInOutCubic),emphasized(easeInOutCubicEmphasized).effectiveDuration(BuildContext, Duration)that readsMediaQuery.disableAnimationsOf(context)and returnsinstantwhen OS reduce-motion is on (A5 will add in-app override later; design API now).Acceptance Criteria
effectiveDurationreturns 0 ms whendisableAnimations: trueinMediaQuery.flutter analyzeclean.Tests
effectiveDurationwith/withoutMediaQuery.disableAnimations.