isParentOf method

bool isParentOf(
  1. WidgetData w1,
  2. WidgetData w2
)

Implementation

bool isParentOf(WidgetData w1, WidgetData w2) {
  WidgetData? w = w2.parent;
  while ( w != null) {
    if (w == w1)
      return true;
    w = w.parent;
  }

  return false;
}