@@ -130,8 +130,9 @@ class Transition extends AnimatedComponent {
130
130
}
131
131
132
132
class HistoryEntry {
133
- HistoryEntry (this .route);
133
+ HistoryEntry ({ this .route, this .key } );
134
134
final RouteBase route;
135
+ final int key;
135
136
// TODO(jackson): Keep track of the requested transition
136
137
}
137
138
@@ -142,11 +143,12 @@ class NavigationState {
142
143
if (route.name != null )
143
144
namedRoutes[route.name] = route;
144
145
}
145
- history.add (new HistoryEntry (routes[0 ]));
146
+ history.add (new HistoryEntry (route : routes[0 ], key : _lastKey ++ ));
146
147
}
147
148
148
149
List <HistoryEntry > history = new List <HistoryEntry >();
149
150
int historyIndex = 0 ;
151
+ int _lastKey = 0 ;
150
152
Map <String , RouteBase > namedRoutes = new Map <String , RouteBase >();
151
153
152
154
RouteBase get currentRoute => history[historyIndex].route;
@@ -159,7 +161,7 @@ class NavigationState {
159
161
}
160
162
161
163
void push (RouteBase route) {
162
- HistoryEntry historyEntry = new HistoryEntry (route);
164
+ HistoryEntry historyEntry = new HistoryEntry (route: route, key : _lastKey ++ );
163
165
history.insert (historyIndex + 1 , historyEntry);
164
166
historyIndex++ ;
165
167
}
@@ -224,9 +226,8 @@ class Navigator extends StatefulComponent {
224
226
}
225
227
if (content == null )
226
228
continue ;
227
- String key = historyEntry.route.key;
228
229
Transition transition = new Transition (
229
- key: key,
230
+ key: historyEntry. key. toString () ,
230
231
content: content,
231
232
direction: (i <= state.historyIndex) ? TransitionDirection .forward : TransitionDirection .reverse,
232
233
interactive: (i == state.historyIndex),
0 commit comments