describeRenderObject method

ElementDataNullable describeRenderObject(
  1. ElementData activeElementData,
  2. Element element,
  3. bool isSensitive,
  4. dynamic changeSensitivity(),
)

Implementation

ElementDataNullable describeRenderObject(
  ElementData activeElementData,
  Element element,
  bool isSensitive,
  Function() changeSensitivity,
) {
  if (element.renderObject is RenderBox) {
    final String dataType = element.renderObject.runtimeType.toString();

    if (SmartlookHelperController.instance.descriptors.containsKey(dataType)) {
      final elementDataNullable = SmartlookHelperController.instance.descriptors[dataType]!.describe(element, activeElementData);

      if (elementDataNullable.elementData == null) {
        return elementDataNullable;
      }

      elementDataNullable.elementData!.isSensitive = isSensitive;
      changeSensitivity();
      activeElementData.addChildren(elementDataNullable.elementData!);

      elementDataNullable.elementData?.applyAncestorMatrix(activeElementData.matrix);

      return elementDataNullable;
    }
  }

  return const ElementDataNullable();
}