getDescendantOffset method

Offset getDescendantOffset({
  1. required RenderBox descendant,
  2. Offset offset = Offset.zero,
})

Calculates the offset of a descendant widget relative to this Roll.

This will be used in the future for the shared gradient sheet functionality to determine which portion of the gradient each descendant Foil should use.

Implementation

Offset getDescendantOffset({
  required RenderBox descendant,
  Offset offset = Offset.zero,
}) => descendant.localToGlobal(
  offset,
  ancestor: context.findRenderObject() as RenderBox,
);