onViewportResize method

  1. @override
void onViewportResize()
override

Override in order to perform a custom action upon resize.

A typical use-case would be to adjust the viewport's clip mask to match the new size.

Implementation

@override
void onViewportResize() {
  final x = size.x / 2;
  final y = size.y / 2;
  _clipPath = Path()..addOval(Rect.fromLTRB(-x, -y, x, y));
}