@@ -45,6 +45,11 @@ abstract class _GoRouteData extends RouteData {
45
45
static UnimplementedError get shouldBeGeneratedError => UnimplementedError (
46
46
'Should be generated using [Type-safe routing](https://pub.dev/documentation/go_router/latest/topics/Type-safe%20routes-topic.html).' ,
47
47
);
48
+
49
+ /// Used to cache [_GoRouteData] that corresponds to a given [GoRouterState]
50
+ /// to minimize the number of times it has to be deserialized.
51
+ static final Expando <_GoRouteData > stateObjectExpando =
52
+ Expando <_GoRouteData >('GoRouteState to _GoRouteData expando' );
48
53
}
49
54
50
55
/// Helper to build a location string from a path and query parameters.
@@ -174,7 +179,7 @@ abstract class GoRouteData extends _GoRouteData {
174
179
}) {
175
180
final _GoRouteParameters params = _createGoRouteParameters <T >(
176
181
factory : factory ,
177
- expando: _stateObjectExpando ,
182
+ expando: _GoRouteData .stateObjectExpando ,
178
183
);
179
184
180
185
return GoRoute (
@@ -190,13 +195,6 @@ abstract class GoRouteData extends _GoRouteData {
190
195
);
191
196
}
192
197
193
- /// Used to cache [GoRouteData] that corresponds to a given [GoRouterState]
194
- /// to minimize the number of times it has to be deserialized.
195
- static final Expando <_GoRouteData > _stateObjectExpando =
196
- Expando <_GoRouteData >(
197
- 'GoRouteState to GoRouteData expando' ,
198
- );
199
-
200
198
/// The location of this route, e.g. /family/f2/person/p1
201
199
String get location => throw _GoRouteData .shouldBeGeneratedError;
202
200
@@ -293,7 +291,7 @@ abstract class RelativeGoRouteData extends _GoRouteData {
293
291
}) {
294
292
final _GoRouteParameters params = _createGoRouteParameters <T >(
295
293
factory : factory ,
296
- expando: _stateObjectExpando ,
294
+ expando: _GoRouteData .stateObjectExpando ,
297
295
);
298
296
299
297
return GoRoute (
@@ -308,13 +306,6 @@ abstract class RelativeGoRouteData extends _GoRouteData {
308
306
);
309
307
}
310
308
311
- /// Used to cache [RelativeGoRouteData] that corresponds to a given [GoRouterState]
312
- /// to minimize the number of times it has to be deserialized.
313
- static final Expando <_GoRouteData > _stateObjectExpando =
314
- Expando <_GoRouteData >(
315
- 'GoRouteState to RelativeGoRouteData expando' ,
316
- );
317
-
318
309
/// The sub-location of this route, e.g. person/p1
319
310
String get subLocation => throw _GoRouteData .shouldBeGeneratedError;
320
311
0 commit comments