import 'package:flutter/widgets.dart'; import 'package:flutter_animate/flutter_animate.dart'; /// Reduced-motion-aware entry animations (S5-R3). /// /// Every entry animation in the app should go through these helpers so the /// OS "disable animations" accessibility setting is honored from a single /// call site. When reduced motion is active the child is returned untouched /// (no [Animate] wrapper at all). extension PluriAnimate on Widget { /// Fade-in entry animation. Widget pluriFadeIn( BuildContext context, { Duration duration = const Duration(milliseconds: 350), Duration delay = Duration.zero, Curve curve = Curves.easeOutCubic, }) { if (_animacionesDeshabilitadas(context)) return this; return animate(delay: delay).fadeIn(duration: duration, curve: curve); } /// Fade + subtle scale entry animation. Widget pluriScaleIn( BuildContext context, { Duration duration = const Duration(milliseconds: 350), Duration delay = Duration.zero, Curve curve = Curves.easeOutCubic, double begin = 0.96, }) { if (_animacionesDeshabilitadas(context)) return this; return animate(delay: delay) .fadeIn(duration: duration, curve: curve) .scaleXY(begin: begin, end: 1, duration: duration, curve: curve); } bool _animacionesDeshabilitadas(BuildContext context) => MediaQuery.maybeDisableAnimationsOf(context) ?? false; }