merge method

RouteOptions merge(
  1. RouteOptions? other
)

Returns a new RouteOptions instance by merging this with other.

For each field, if other provides a non-null value, it overrides this instance's corresponding value; otherwise, this instance's value is retained.

Implementation

RouteOptions merge(RouteOptions? other) {
  if (other == null) return this;

  return RouteOptions(
    fullscreenDialog: other.fullscreenDialog ?? fullscreenDialog,
    maintainState: other.maintainState ?? maintainState,
    allowSnapshotting: other.allowSnapshotting ?? allowSnapshotting,
    barrierDismissible: other.barrierDismissible ?? barrierDismissible,
    requestFocus: other.requestFocus ?? requestFocus,
  );
}