getChildFor method

  1. @override
RenderBox? getChildFor(
  1. covariant ChildVicinity vicinity, {
  2. bool mapMergedVicinityToCanonicalChild = true,
})
override

Returns the active child located at the provided ChildVicinity, if there is one.

This can be used by subclasses to access currently active children to make use of their size or TwoDimensionalViewportParentData, such as when overriding the paint method.

Returns null if there is no active child for the given ChildVicinity.

Implementation

@override
RenderBox? getChildFor(
  ChildVicinity vicinity, {
  bool mapMergedVicinityToCanonicalChild = true,
}) {
  return super.getChildFor(vicinity) ??
      (mapMergedVicinityToCanonicalChild
          ? _getMergedChildFor(vicinity as TableVicinity)
          : null);
}