getRectsInSelection method
Returns a List of the Rect area within selection in current widget.
The return result must be a List of the Rect under the local coordinate system.
Implementation
@override
List<Rect> getRectsInSelection(
Selection selection, {
bool shiftWithBaseOffset = false,
}) {
if (_renderBox == null) {
return [];
}
final parentBox = context.findRenderObject();
final videoBox = videoKey.currentContext?.findRenderObject();
if (parentBox is RenderBox && videoBox is RenderBox) {
return [
videoBox.localToGlobal(Offset.zero, ancestor: parentBox) &
videoBox.size,
];
}
return [Offset.zero & _renderBox!.size];
}