copyWith method

UrlState copyWith({
  1. List<RouteMatch>? segments,
  2. Uri? uri,
  3. bool? shouldReplace,
  4. Object? pathState,
})

Returns a new UrlState instance with replaced properties

Implementation

UrlState copyWith({
  List<RouteMatch>? segments,
  Uri? uri,
  bool? shouldReplace,
  Object? pathState,
}) {
  return UrlState(
    uri ?? this.uri,
    segments ?? this.segments,
    shouldReplace: shouldReplace ?? this.shouldReplace,
    pathState: pathState ?? this.pathState,
  );
}