@@ -138,7 +138,7 @@ enum RoutePopDisposition {
138
138
/// The type argument `T` is the route's return type, as used by
139
139
/// [currentResult] , [popped] , and [didPop] . The type `void` may be used if the
140
140
/// route does not return a value.
141
- abstract class Route <T > {
141
+ abstract class Route <T > extends _RoutePlaceholder {
142
142
/// Initialize the [Route] .
143
143
///
144
144
/// If the [settings] are not provided, an empty [RouteSettings] object is
@@ -2896,10 +2896,9 @@ enum _RouteLifecycle {
2896
2896
2897
2897
typedef _RouteEntryPredicate = bool Function (_RouteEntry entry);
2898
2898
2899
- class _NotAnnounced extends Route <void > {
2900
- // A placeholder for the lastAnnouncedPreviousRoute, the
2901
- // lastAnnouncedPoppedNextRoute, and the lastAnnouncedNextRoute before any
2902
- // change has been announced.
2899
+ /// Placeholder for a route.
2900
+ class _RoutePlaceholder {
2901
+ const _RoutePlaceholder ();
2903
2902
}
2904
2903
2905
2904
class _RouteEntry extends RouteTransitionRecord {
@@ -2937,12 +2936,12 @@ class _RouteEntry extends RouteTransitionRecord {
2937
2936
/// remove as a result of a page update.
2938
2937
static const int kDebugPopAttemptLimit = 100 ;
2939
2938
2940
- static final Route < dynamic > notAnnounced = _NotAnnounced ();
2939
+ static const _RoutePlaceholder notAnnounced = _RoutePlaceholder ();
2941
2940
2942
2941
_RouteLifecycle currentState;
2943
- Route < dynamic > ? lastAnnouncedPreviousRoute = notAnnounced; // last argument to Route.didChangePrevious
2944
- WeakReference <Route < dynamic >> lastAnnouncedPoppedNextRoute = WeakReference <Route < dynamic > >(notAnnounced); // last argument to Route.didPopNext
2945
- Route < dynamic > ? lastAnnouncedNextRoute = notAnnounced; // last argument to Route.didChangeNext
2942
+ _RoutePlaceholder ? lastAnnouncedPreviousRoute = notAnnounced; // last argument to Route.didChangePrevious
2943
+ WeakReference <_RoutePlaceholder > lastAnnouncedPoppedNextRoute = WeakReference <_RoutePlaceholder >(notAnnounced); // last argument to Route.didPopNext
2944
+ _RoutePlaceholder ? lastAnnouncedNextRoute = notAnnounced; // last argument to Route.didChangeNext
2946
2945
int ? lastFocusNode; // The last focused semantic node for the route entry.
2947
2946
2948
2947
/// Restoration ID to be used for the encapsulating route when restoration is
0 commit comments