Unverified Commit 9c8ee4fa authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Document that you can't change initialRoute usefully (#130450)

Fixes https://github.com/flutter/flutter/issues/12454
parent 28dfd836
...@@ -725,6 +725,10 @@ class WidgetsApp extends StatefulWidget { ...@@ -725,6 +725,10 @@ class WidgetsApp extends StatefulWidget {
/// [routes], [onGenerateRoute], or [onUnknownRoute]); if they are not, /// [routes], [onGenerateRoute], or [onUnknownRoute]); if they are not,
/// [initialRoute] must be null and [builder] must not be null. /// [initialRoute] must be null and [builder] must not be null.
/// ///
/// Changing the [initialRoute] will have no effect, as it only controls the
/// _initial_ route. To change the route while the application is running, use
/// the [Navigator] or [Router] APIs.
///
/// See also: /// See also:
/// ///
/// * [Navigator.initialRoute], which is used to implement this property. /// * [Navigator.initialRoute], which is used to implement this property.
......
...@@ -1470,6 +1470,10 @@ class Navigator extends StatefulWidget { ...@@ -1470,6 +1470,10 @@ class Navigator extends StatefulWidget {
/// ///
/// The value is interpreted according to [onGenerateInitialRoutes], which /// The value is interpreted according to [onGenerateInitialRoutes], which
/// defaults to [defaultGenerateInitialRoutes]. /// defaults to [defaultGenerateInitialRoutes].
///
/// Changing the [initialRoute] will have no effect, as it only controls the
/// _initial_ route. To change the route while the application is running, use
/// the static functions on this class, such as [push] or [replace].
final String? initialRoute; final String? initialRoute;
/// Called to generate a route for a given [RouteSettings]. /// Called to generate a route for a given [RouteSettings].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment