hasSameStyleWith method

bool hasSameStyleWith (
  1. TextStyleBuilder other
)

Returns true if this shares same styling with other.

Implementation

bool hasSameStyleWith(TextStyleBuilder other) {
  if (other == null) return false;

  var thisWithBuilder = this;
  while (thisWithBuilder._builders == null) {
    if (thisWithBuilder.parent == null) break;
    thisWithBuilder = thisWithBuilder.parent;
  }

  var otherWithBuilder = other;
  while (otherWithBuilder._builders == null) {
    if (otherWithBuilder.parent == null) break;
    otherWithBuilder = otherWithBuilder.parent;
  }

  return thisWithBuilder == otherWithBuilder;
}