inherit static method

FontSize? inherit(
  1. FontSize? parent,
  2. FontSize? child
)

Implementation

static FontSize? inherit(FontSize? parent, FontSize? child) {
  if (child != null && parent != null) {
    if (child.unit == Unit.em) {
      return FontSize(child.value * parent.value);
    } else if (child.unit == Unit.percent) {
      return FontSize(child.value / 100.0 * parent.value);
    }
    return child;
  }

  return parent;
}