Skip to content

Commit

Permalink
Create migration guide for RouteSettings.copywith (#7694)
Browse files Browse the repository at this point in the history
* Create migration guide for RouteSettings.copywith

needs to wait for pr to land flutter/flutter#113860

* Update routesettings-copywith-migration.md

* Update routesettings-copywith-migration.md

* Update routesettings-copywith-migration.md

* Update routesettings-copywith-migration.md

* Update src/release/breaking-changes/routesettings-copywith-migration.md

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>

* Update src/release/breaking-changes/routesettings-copywith-migration.md

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>

* Update src/release/breaking-changes/routesettings-copywith-migration.md

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>

* Update src/release/breaking-changes/routesettings-copywith-migration.md

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>

* add to index

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Anthony Sansone <atsansone@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 1, 2022
1 parent d42d0ce commit 1450b1a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/release/breaking-changes/index.md
Expand Up @@ -22,6 +22,7 @@ release, and listed in alphabetical order:
* [iOS FlutterViewController splashScreenView made nullable][]
* [ThemeData's toggleableActiveColor property has been deprecated][]

[Removed RouteSettings.copyWith]: {{site.url}}/release/breaking-changes/routesettings-copywith-migration
[Deprecated API removed after v3.3]: {{site.url}}/release/breaking-changes/3-3-deprecations
[ThemeData's toggleableActiveColor property has been deprecated]: {{site.url}}/release/breaking-changes/toggleable-active-color
[iOS FlutterViewController splashScreenView made nullable]: {{site.url}}/release/breaking-changes/ios-flutterviewcontroller-splashscreenview-nullable
Expand Down
48 changes: 48 additions & 0 deletions src/release/breaking-changes/routesettings-copywith-migration.md
@@ -0,0 +1,48 @@
---
title: Migration guide for RouteSettings copyWith
description: Removal of RouteSettings copyWith and how to migrate
---

## 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<br>
In stable release: TBA

## References

Relevant PRs:

* [PR 113860][]: Removes RouteSetting.copyWith.

[PR 113860]: {{site.repo.flutter}}/pull/113860
[`Page`]: {{site.api}}/flutter/widgets/Page-class.html

0 comments on commit 1450b1a

Please sign in to comment.