collectApplicableChildren method

  1. @override
Iterable<Component> collectApplicableChildren({
  1. required Component rootComponent,
})
inherited

Implementation

@override
Iterable<Component> collectApplicableChildren({
  required Component rootComponent,
}) {
  return rootComponent.componentsAtLocation(
    (
      start: canvasStartPosition,
      end: canvasEndPosition,
    ),
    renderingTrace,
    (transform, context) {
      final start = context.start;
      final transformedStart = transform.parentToLocal(start);

      final end = context.end;
      final transformedEnd = transform.parentToLocal(end);

      if (transformedStart == null || transformedEnd == null) {
        return null;
      }
      return (
        start: transformedStart,
        end: transformedEnd,
      );
    },
    // we only trigger the drag start if the component check passes, but
    // as the user drags the cursor it could end up outside the component
    // bounds; we don't want the event to be lost, so we bypass the check.
    (component, context) => true,
  );
}