copyWith method Null safety

RouteSettings copyWith(
  1. {String? name,
  2. Object? arguments}
)

Creates a copy of this route settings object with the given fields replaced with the new values.

Implementation

RouteSettings copyWith({
  String? name,
  Object? arguments,
}) {
  return RouteSettings(
    name: name ?? this.name,
    arguments: arguments ?? this.arguments,
  );
}