@@ -55,8 +55,9 @@ typedef RouteListFactory = List<Route<dynamic>> Function(NavigatorState navigato
55
55
///
56
56
/// Used by the restorable methods of the [Navigator] that add anonymous routes
57
57
/// (e.g. [NavigatorState.restorablePush] ). For this use case, the
58
- /// [RestorableRouteBuilder] must be static function as the [Navigator] will
59
- /// call it again during state restoration to re-create the route.
58
+ /// [RestorableRouteBuilder] must be static function annotated with
59
+ /// `@pragma('vm:entry-point')` . The [Navigator] will call it again during
60
+ /// state restoration to re-create the route.
60
61
typedef RestorableRouteBuilder <T > = Route <T > Function (BuildContext context, Object ? arguments);
61
62
62
63
/// Signature for the [Navigator.popUntil] predicate argument.
@@ -2108,9 +2109,10 @@ class Navigator extends StatefulWidget {
2108
2109
/// {@macro flutter.widgets.navigator.push}
2109
2110
///
2110
2111
/// {@template flutter.widgets.Navigator.restorablePush}
2111
- /// The method takes a _static_ [RestorableRouteBuilder] as argument, which
2112
- /// must instantiate and return a new [Route] object that will be added to
2113
- /// the navigator. The provided `arguments` object is passed to the
2112
+ /// The method takes a [RestorableRouteBuilder] as argument, which must be a
2113
+ /// _static_ function annotated with `@pragma('vm:entry-point')` . It must
2114
+ /// instantiate and return a new [Route] object that will be added to the
2115
+ /// navigator. The provided `arguments` object is passed to the
2114
2116
/// `routeBuilder` . The navigator calls the static `routeBuilder` function
2115
2117
/// again during state restoration to re-create the route object.
2116
2118
///
0 commit comments