onViewportResize function

void Function() onViewportResize(
  1. void callback()
)

Assina o evento resize da janela; retorna uma função que cancela a assinatura.

Implementation

void Function() onViewportResize(void Function() callback) {
  void handler(web.Event _) => callback();
  final jsHandler = handler.toJS;
  web.window.addEventListener('resize', jsHandler);
  return () => web.window.removeEventListener('resize', jsHandler);
}