respect disableAnimations flag

This commit is contained in:
Fabian Freund
2026-03-09 18:03:34 +01:00
parent a815a3529a
commit 0a8348b324
8 changed files with 102 additions and 19 deletions
@@ -53,19 +53,21 @@ class SyncSettingsScreen extends HookConsumerWidget {
return 'Last synced: $formattedDate';
}, [syncInfo, isSyncing]);
final disableAnimations = MediaQuery.disableAnimationsOf(context);
final syncController = useAnimationController(
duration: const Duration(seconds: 2),
duration: disableAnimations ? Duration.zero : const Duration(seconds: 2),
);
useEffect(() {
if (isSyncing) {
if (isSyncing && !disableAnimations) {
unawaited(syncController.repeat());
} else {
syncController.stop();
syncController.reset();
}
return null;
}, [isSyncing]);
}, [isSyncing, disableAnimations]);
return Scaffold(
appBar: AppBar(title: const Text('Firefox Sync')),