Skip to content

Commit 4efa53e

Browse files
committed
Honor reduced motion in mobile tab bar
1 parent 9583446 commit 4efa53e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎mobile/lib/features/home/home_page.dart‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class _FloatingTabBar extends StatelessWidget {
107107
Widget build(BuildContext context) {
108108
final colorScheme = Theme.of(context).colorScheme;
109109
final isDark = Theme.of(context).brightness == Brightness.dark;
110+
final reducedMotion = MediaQuery.of(context).disableAnimations;
110111
if (destinations.isEmpty) {
111112
return const SizedBox.shrink();
112113
}
@@ -199,7 +200,9 @@ class _FloatingTabBar extends StatelessWidget {
199200
children: [
200201
AnimatedAlign(
201202
alignment: selectedAlignment,
202-
duration: const Duration(milliseconds: 180),
203+
duration: reducedMotion
204+
? Duration.zero
205+
: const Duration(milliseconds: 180),
203206
curve: Curves.easeOutCubic,
204207
child: FractionallySizedBox(
205208
widthFactor: 1 / destinationCount,

0 commit comments

Comments
 (0)