isCompatibleWith method

bool isCompatibleWith(
  1. SemanticsConfiguration? other
)

Whether this configuration is compatible with the provided other configuration.

Two configurations are said to be compatible if they can be added to the same SemanticsNode without losing any semantics information.

Implementation

bool isCompatibleWith(SemanticsConfiguration? other) {
  if (other == null || !other.hasBeenAnnotated || !hasBeenAnnotated) {
    return true;
  }
  if (_actionsAsBits & other._actionsAsBits != 0) {
    return false;
  }
  if ((_flags & other._flags) != 0) {
    return false;
  }
  if (_platformViewId != null && other._platformViewId != null) {
    return false;
  }
  if (_maxValueLength != null && other._maxValueLength != null) {
    return false;
  }
  if (_currentValueLength != null && other._currentValueLength != null) {
    return false;
  }
  if (_attributedValue.string.isNotEmpty && other._attributedValue.string.isNotEmpty) {
    return false;
  }
  return true;
}