Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit e3030a2

Browse files
authored
Merge pull request #151 from Unity-Technologies/zgh/fix/navigation
fix pushReplacementNamed<T,TO>
2 parents 7d34ef6 + 9782797 commit e3030a2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

com.unity.uiwidgets/Runtime/widgets/navigator.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ public Route _routeNamed(string name, object arguments, bool allowNull = false)
16331633
return route;
16341634
}
16351635

1636-
public Route<T> _routeNamed<T>(string name, object arguments, bool allowNull = false) {
1636+
public Route _routeNamed<T>(string name, object arguments, bool allowNull = false) {
16371637
D.assert(!_debugLocked);
16381638
D.assert(name != null);
16391639
if (allowNull && widget.onGenerateRoute == null)
@@ -1657,8 +1657,7 @@ public Route<T> _routeNamed<T>(string name, object arguments, bool allowNull = f
16571657
arguments: arguments
16581658
);
16591659

1660-
var routeee = widget.onGenerateRoute(settings);
1661-
Route<T> route = routeee as Route<T>;
1660+
Route route = widget.onGenerateRoute(settings);
16621661
if (route == null && !allowNull) {
16631662
D.assert(() => {
16641663
if (widget.onUnknownRoute == null) {
@@ -1673,7 +1672,7 @@ public Route<T> _routeNamed<T>(string name, object arguments, bool allowNull = f
16731672

16741673
return true;
16751674
});
1676-
route = widget.onUnknownRoute(settings) as Route<T>;
1675+
route = widget.onUnknownRoute(settings);
16771676
D.assert(() => {
16781677
if (route == null) {
16791678
throw new UIWidgetsError(
@@ -1811,7 +1810,7 @@ void _afterNavigation(Route route) {
18111810

18121811

18131812

1814-
public Future<T> pushReplacement<T, TO>(Route<T> newRoute, TO result) {
1813+
public Future<T> pushReplacement<T, TO>(Route newRoute, TO result) {
18151814
D.assert(!_debugLocked);
18161815
D.assert(() => {
18171816
_debugLocked = true;
@@ -1882,7 +1881,7 @@ public Future pushReplacement(Route newRoute, object result) {
18821881
}
18831882

18841883

1885-
public Future<T> pushAndRemoveUntil<T>(Route<T> newRoute, RoutePredicate predicate) {
1884+
public Future<T> pushAndRemoveUntil<T>(Route newRoute, RoutePredicate predicate) {
18861885
D.assert(!_debugLocked);
18871886
D.assert(() => {
18881887
_debugLocked = true;

com.unity.uiwidgets/Runtime/widgets/routes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ protected virtual void setState(VoidCallback fn) {
640640
}
641641
}
642642

643-
public RoutePredicate withName(string name) {
643+
public static RoutePredicate withName(string name) {
644644
return (Route route) => !route.willHandlePopInternally
645645
&& route is ModalRoute
646646
&& route.settings.name == name;

0 commit comments

Comments
 (0)