diff --git a/packages/flutter/lib/src/widgets/app.dart b/packages/flutter/lib/src/widgets/app.dart index c641566c384..af5d404c430 100644 --- a/packages/flutter/lib/src/widgets/app.dart +++ b/packages/flutter/lib/src/widgets/app.dart @@ -725,6 +725,10 @@ class WidgetsApp extends StatefulWidget { /// [routes], [onGenerateRoute], or [onUnknownRoute]); if they are not, /// [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: /// /// * [Navigator.initialRoute], which is used to implement this property. diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index 353b0614fcc..43156aa44e2 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -1470,6 +1470,10 @@ class Navigator extends StatefulWidget { /// /// The value is interpreted according to [onGenerateInitialRoutes], which /// 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; /// Called to generate a route for a given [RouteSettings].