overrideWith method

BuilderOptions overrideWith(
  1. BuilderOptions? other
)

Returns a new set of options with keys from other overriding options in this instance.

Config values are overridden at a per-key granularity. There is no value level merging. other may be null, in which case this instance is returned directly.

The isRoot value will also be overridden to value from other.

Implementation

BuilderOptions overrideWith(BuilderOptions? other) {
  // ignore: avoid_returning_this
  if (other == null) return this;
  return BuilderOptions(
      {}
        ..addAll(config)
        ..addAll(other.config),
      isRoot: other.isRoot);
}