getTransformFrom method Null safety

Matrix4 getTransformFrom(
  1. Selectable child
)

Gets the paint transform from the Selectable child to SelectionContainer of this delegate.

Returns a matrix that maps the Selectable paint coordinate system to the coordinate system of SelectionContainer.

Can only be called after SelectionContainer is laid out.

Implementation

Matrix4 getTransformFrom(Selectable child) {
  assert(
    _selectionContainerContext?.findRenderObject() != null,
    'getTransformFrom cannot be called before SelectionContainer is laid out.',
  );
  return child.getTransformTo(_selectionContainerContext!.findRenderObject()! as RenderBox);
}