merge method Null safety

ResponsiveBreakpoint merge(
  1. ResponsiveBreakpoint responsiveBreakpoint
)

Merge overwrite operation.

Overwrite existing values with new values from responsiveBreakpoint.

Implementation

ResponsiveBreakpoint merge(ResponsiveBreakpoint responsiveBreakpoint) {
  // Tag does not overwrite existing behavior.
  // Preserve existing values when merging.
  if (responsiveBreakpoint.isTag && !this.isTag)
    return this.copyWith(name: responsiveBreakpoint.name ?? this.name);
  return responsiveBreakpoint.copyWith(
      name: responsiveBreakpoint.name ?? this.name);
}