nit: use the lambda syntax here:

    html.window.onResize.listen((_) => resize());