Skip to content

Commit

Permalink
Remove RouteSetting.copyWith (flutter#113860)
Browse files Browse the repository at this point in the history
  • Loading branch information
chunhtai committed Oct 27, 2022
1 parent f60b44d commit c6f6095
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
12 changes: 0 additions & 12 deletions packages/flutter/lib/src/widgets/navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -537,18 +537,6 @@ class RouteSettings {
this.arguments,
});

/// Creates a copy of this route settings object with the given fields
/// replaced with the new values.
RouteSettings copyWith({
String? name,
Object? arguments,
}) {
return RouteSettings(
name: name ?? this.name,
arguments: arguments ?? this.arguments,
);
}

/// The name of the route (e.g., "/settings").
///
/// If null, the route is anonymous.
Expand Down
10 changes: 0 additions & 10 deletions packages/flutter/test/widgets/routes_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ void main() {
testWidgets('Route settings', (WidgetTester tester) async {
const RouteSettings settings = RouteSettings(name: 'A');
expect(settings, hasOneLineDescription);
final RouteSettings settings2 = settings.copyWith(name: 'B');
expect(settings2.name, 'B');
});

testWidgets('Route settings arguments', (WidgetTester tester) async {
Expand All @@ -127,14 +125,6 @@ void main() {
final Object arguments = Object();
final RouteSettings settings2 = RouteSettings(name: 'A', arguments: arguments);
expect(settings2.arguments, same(arguments));

final RouteSettings settings3 = settings2.copyWith();
expect(settings3.arguments, equals(arguments));

final Object arguments2 = Object();
final RouteSettings settings4 = settings2.copyWith(arguments: arguments2);
expect(settings4.arguments, same(arguments2));
expect(settings4.arguments, isNot(same(arguments)));
});

testWidgets('Route management - push, replace, pop sequence', (WidgetTester tester) async {
Expand Down

0 comments on commit c6f6095

Please sign in to comment.