Skip to content

Commit

Permalink
feat: disable page transitions for "reduce motion"
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed May 16, 2024
1 parent 3506adc commit 3df5de0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,17 @@ class _HomePageButtonState<T> extends State<_HomePageButton<T>> {
return;
}

Navigator.of(context).push(
NesVerticalCloseTransition.route<void>(
pageBuilder: widget.openBuilder,
duration: Prefs.fasterPageTransitions.value
? const Duration(milliseconds: 450)
: const Duration(milliseconds: 750),
),
);
final route = MediaQuery.disableAnimationsOf(context)
? PageRouteBuilder(
pageBuilder: widget.openBuilder,
)
: NesVerticalCloseTransition.route<void>(
pageBuilder: widget.openBuilder,
duration: Prefs.fasterPageTransitions.value
? const Duration(milliseconds: 450)
: const Duration(milliseconds: 750),
);
Navigator.of(context).push(route);
}

@override
Expand Down

0 comments on commit 3df5de0

Please sign in to comment.