Commit 4e513822 authored by Hixie's avatar Hixie

Turn the LocalHistoryRoute into a mixin.

parent 1e8fa404
...@@ -61,6 +61,11 @@ abstract class TransitionRoute<T> extends OverlayRoute<T> { ...@@ -61,6 +61,11 @@ abstract class TransitionRoute<T> extends OverlayRoute<T> {
}) : _popCompleter = popCompleter, }) : _popCompleter = popCompleter,
_transitionCompleter = transitionCompleter; _transitionCompleter = transitionCompleter;
TransitionRoute.explicit(
Completer<T> popCompleter,
Completer<T> transitionCompleter
) : this(popCompleter: popCompleter, transitionCompleter: transitionCompleter);
/// This future completes once the animation has been dismissed. For /// This future completes once the animation has been dismissed. For
/// ModalRoutes, this will be after the completer that's passed in, since that /// 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 /// one completes before the animation even starts, as soon as the route is
...@@ -148,15 +153,7 @@ class LocalHistoryEntry { ...@@ -148,15 +153,7 @@ class LocalHistoryEntry {
} }
} }
abstract class LocalHistoryRoute<T> extends TransitionRoute<T> { abstract class LocalHistoryRoute<T> extends Route<T> {
LocalHistoryRoute({
Completer<T> popCompleter,
Completer<T> transitionCompleter
}) : super(
popCompleter: popCompleter,
transitionCompleter: transitionCompleter
);
List<LocalHistoryEntry> _localHistory; List<LocalHistoryEntry> _localHistory;
void addLocalHistoryEntry(LocalHistoryEntry entry) { void addLocalHistoryEntry(LocalHistoryEntry entry) {
assert(entry._owner == null); assert(entry._owner == null);
...@@ -268,11 +265,11 @@ class ModalPosition { ...@@ -268,11 +265,11 @@ class ModalPosition {
final double left; final double left;
} }
abstract class ModalRoute<T> extends LocalHistoryRoute<T> { abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T> {
ModalRoute({ ModalRoute({
Completer<T> completer, Completer<T> completer,
this.settings: const NamedRouteSettings() this.settings: const NamedRouteSettings()
}) : super(popCompleter: completer); }) : super.explicit(completer, null);
// The API for general users of this class // The API for general users of this class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment