merge method

Border merge (Border a, Border b)

Creates a Border that represents the addition of the two given Borders.

It is only valid to call this if BorderSide.canMerge returns true for the pairwise combination of each side on both Borders.

The arguments must not be null.

Implementation

static Border merge(Border a, Border b) {
  assert(a != null);
  assert(b != null);
  assert(BorderSide.canMerge(a.top, b.top));
  assert(BorderSide.canMerge(a.right, b.right));
  assert(BorderSide.canMerge(a.bottom, b.bottom));
  assert(BorderSide.canMerge(a.left, b.left));
  return Border(
    top: BorderSide.merge(a.top, b.top),
    right: BorderSide.merge(a.right, b.right),
    bottom: BorderSide.merge(a.bottom, b.bottom),
    left: BorderSide.merge(a.left, b.left),
  );
}