merge method

DisplayConfig merge(
  1. DisplayConfig? override
)

Returns a new DisplayConfig where each non-null field of override replaces the corresponding field of this. Null fields in override keep the value from this. Used to apply mode-specific configs on top of the default DisplayConfig — see Origin.modes.

Note: Map fields (drag, scale) follow the same "non-null wins" rule, so passing an empty {} in override explicitly disables (vs null which inherits).

Implementation

DisplayConfig merge(DisplayConfig? override) {
  if (override == null) return this;
  return DisplayConfig(
    drag: override.drag ?? drag,
    scale: override.scale ?? scale,
    constraints: override.constraints ?? constraints,
    onRelease: override.onRelease ?? onRelease,
    onTap: override.onTap ?? onTap,
    onDoubleTap: override.onDoubleTap ?? onDoubleTap,
    doubleTapPullFactor: override.doubleTapPullFactor ?? doubleTapPullFactor,
    dragPromote: override.dragPromote ?? dragPromote,
    scaleVelocityCancel: override.scaleVelocityCancel ?? scaleVelocityCancel,
    crop: override.crop ?? crop,
    overlay: override.overlay ?? overlay,
    display: override.display ?? display,
    displayContainer: override.displayContainer ?? displayContainer,
    overrides: override.overrides ?? overrides,
    builder: override.builder ?? builder,
    onTapOutside: override.onTapOutside ?? onTapOutside,
  );
}