popTransform method Null safety

  1. @protected
void popTransform()

Removes the last transform added via pushTransform or pushOffset.

This method is only to be used by subclasses, which must provide coordinate space specific public wrappers around this function for their users (see BoxHitTestResult.addWithPaintTransform for such an example).

This method must be called after hit testing is done on a child that required a call to pushTransform or pushOffset.

See also:

Implementation

@protected
void popTransform() {
  if (_localTransforms.isNotEmpty)
    _localTransforms.removeLast();
  else
    _transforms.removeLast();
  assert(_transforms.isNotEmpty);
}