onResized method

void onResized(
  1. String id,
  2. void callback(
    1. Size size
    )
)

Called when window resizes.

Implementation

void onResized(String id, void Function(Size size) callback) {
  onWindowEvent(id, 'resized', (event) {
    callback(Size(
      (event.data['width'] as num).toDouble(),
      (event.data['height'] as num).toDouble(),
    ));
  });
}