absorb method

void absorb (SemanticsConfiguration child)

Absorb the semantic information from child into this configuration.

This adds the semantic information of both configurations and saves the result in this configuration.

The RenderObject owning the child configuration must be a descendant of the RenderObject that owns this configuration.

Only configurations that have explicitChildNodes set to false can absorb other configurations and it is recommended to only absorb compatible configurations as determined by isCompatibleWith.

Implementation

void absorb(SemanticsConfiguration child) {
  assert(!explicitChildNodes);

  if (!child.hasBeenAnnotated)
    return;

  _actions.addAll(child._actions);
  _customSemanticsActions.addAll(child._customSemanticsActions);
  _actionsAsBits |= child._actionsAsBits;
  _flags |= child._flags;
  _textSelection ??= child._textSelection;
  _scrollPosition ??= child._scrollPosition;
  _scrollExtentMax ??= child._scrollExtentMax;
  _scrollExtentMin ??= child._scrollExtentMin;
  _hintOverrides ??= child._hintOverrides;
  _indexInParent ??= child.indexInParent;
  _scrollIndex ??= child._scrollIndex;
  _scrollChildCount ??= child._scrollChildCount;
  _platformViewId ??= child._platformViewId;

  textDirection ??= child.textDirection;
  _sortKey ??= child._sortKey;
  _label = _concatStrings(
    thisString: _label,
    thisTextDirection: textDirection,
    otherString: child._label,
    otherTextDirection: child.textDirection,
  );
  if (_decreasedValue == '' || _decreasedValue == null)
    _decreasedValue = child._decreasedValue;
  if (_value == '' || _value == null)
    _value = child._value;
  if (_increasedValue == '' || _increasedValue == null)
    _increasedValue = child._increasedValue;
  _hint = _concatStrings(
    thisString: _hint,
    thisTextDirection: textDirection,
    otherString: child._hint,
    otherTextDirection: child.textDirection,
  );

  _thickness = math.max(_thickness, child._thickness + child._elevation);

  _hasBeenAnnotated = _hasBeenAnnotated || child._hasBeenAnnotated;
}