Migration guide for RouteSettings copyWith
Summary
#The RouteSettings.copyWith
method is removed, and apps that use it need to use the constructor to create a new RouteSettings
instance instead.
Context
#With the introduction of the Page
class, the RouteSettings.copyWith
was no longer a viable API.
Description of change
#RouteSettings.copyWith
was removed
Migration guide
#Code before migration:
dart
RouteSettings newSettings = oldSettings.copyWith(name: 'new name');
Code after migration:
dart
RouteSettings newSettings = RouteSettings(name: 'new name', arguments: oldSettings.arguments);
Timeline
#Landed in version: 3.5.0-9.0.pre-137-gc6f6095acd
In stable release: 3.7
References
#Relevant PRs:
- PR 113860: Removes RouteSetting.copyWith.
除非另有说明,否则本网站上的文档反映的是 Flutter 的最新稳定版本。页面最后更新于 2025-01-30。 查看源代码 或 报告问题。