Skip to content

Commit

Permalink
Merge pull request #15 from zim32/zim32-patch-2
Browse files Browse the repository at this point in the history
Add parameter to control transition duration
  • Loading branch information
JonasWanke committed Jun 9, 2021
2 parents a21927d + 92516ba commit b4c8eaa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/page_route.dart
Expand Up @@ -20,7 +20,9 @@ class SwipeablePageRoute<T> extends CupertinoPageRoute<T> {
RouteSettings? settings,
bool maintainState = true,
bool fullscreenDialog = false,
}) : super(
Duration? transitionDuration,
}) : _transitionDuration = transitionDuration,
super(
builder: builder,
title: title,
settings: settings,
Expand All @@ -32,6 +34,12 @@ class SwipeablePageRoute<T> extends CupertinoPageRoute<T> {
///
/// Set this to `false` to disable swiping completely.
bool canSwipe;
/// An optional override for the [transitionDuration].
final Duration? _transitionDuration;

@override
Duration get transitionDuration =>
_transitionDuration ?? super.transitionDuration;

/// Whether only back gestures close to the left (LTR) or right (RTL) screen
/// edge are counted.
Expand Down

0 comments on commit b4c8eaa

Please sign in to comment.