diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 4586a217b0f..c27fa45539c 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -61,6 +61,11 @@ abstract class TransitionRoute extends OverlayRoute { }) : _popCompleter = popCompleter, _transitionCompleter = transitionCompleter; + TransitionRoute.explicit( + Completer popCompleter, + Completer transitionCompleter + ) : this(popCompleter: popCompleter, transitionCompleter: transitionCompleter); + /// This future completes once the animation has been dismissed. For /// ModalRoutes, this will be after the completer that's passed in, since that /// one completes before the animation even starts, as soon as the route is @@ -148,15 +153,7 @@ class LocalHistoryEntry { } } -abstract class LocalHistoryRoute extends TransitionRoute { - LocalHistoryRoute({ - Completer popCompleter, - Completer transitionCompleter - }) : super( - popCompleter: popCompleter, - transitionCompleter: transitionCompleter - ); - +abstract class LocalHistoryRoute extends Route { List _localHistory; void addLocalHistoryEntry(LocalHistoryEntry entry) { assert(entry._owner == null); @@ -268,11 +265,11 @@ class ModalPosition { final double left; } -abstract class ModalRoute extends LocalHistoryRoute { +abstract class ModalRoute extends TransitionRoute with LocalHistoryRoute { ModalRoute({ Completer completer, this.settings: const NamedRouteSettings() - }) : super(popCompleter: completer); + }) : super.explicit(completer, null); // The API for general users of this class