merge method

BlockTheme merge(
  1. BlockTheme other

Creates a new BlockTheme where each property from this object has been merged with the matching property from the other object.

Text style is merged using TextStyle.merge when this and other theme have this field set.

If padding property is set in other then it replaces value of this theme. linePadding follows the same logic.


BlockTheme merge(BlockTheme other) {
  if (other == null) return this;
  return copyWith(
    textStyle: textStyle?.merge(other.textStyle) ?? other.textStyle,
    inheritLineTextStyle: other.inheritLineTextStyle ?? inheritLineTextStyle,
    padding: other.padding ?? padding,
    linePadding: other.linePadding ?? linePadding,