The `RouteSettings.copyWith` method is removed, and apps that use it need to use the constructor to create a new `RouteSettings` instance instead.
Original behavior
With the introduction of the `Page` class, the `RouteSettings.copyWith` was no longer a viable API.
New behavior
`RouteSettings.copyWith` was removed
- Who is affected
- Any code still referencing the removed API will fail to compile after upgrading. Code that uses RouteSettings.copyWith, RouteSettings, Page.
- Practical impact
- Compile errors until migrated; must be addressed before upgrading.
- What action should I take?
- Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.
Before and after (from the official guide)
dart+1−1
Before
| 1 | − | RouteSettings newSettings = oldSettings.copyWith(name: 'new name'); |
After
| 1 | + | RouteSettings newSettings = RouteSettings(name: 'new name', arguments: oldSettings.arguments); |
Raw before / after
RouteSettings newSettings = oldSettings.copyWith(name: 'new name');
RouteSettings newSettings = RouteSettings(name: 'new name', arguments: oldSettings.arguments);
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
Code before migration:
RouteSettings newSettings = oldSettings.copyWith(name: 'new name');Code after migration:
RouteSettings newSettings = RouteSettings(name: 'new name', arguments: oldSettings.arguments);Migration assistantAI-generated · grounded in cited sources
AI explanations are not configured
Set
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Official migration guide·Verified classification (90%)
Listed in the official breaking-changes index; title states removal.
An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.
Validation warnings
api-symbols: {"reason":"no referenced symbol found in the current API index","unresolved":["RouteSettings.copyWith","RouteSettings","Page"]}
- Source commit
- b3045439b7c0
- Source last updated
- Oct 21, 2026
- Last synchronized
- Oct 21, 2026
- Publication status
- published
Publication history
- Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI explanationAI-generated · grounded in cited sources
AI explanations are not configured
Set
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Was this useful?