listen(callbackFunction)Use instead listen((SomeEvent e) => callbackFunction(e, myOtherParameter));.
For example,
document.querySelector("div#someElement")
.onClick.listen((MouseEvent e) => callbackFunction(e, myOtherParameter))
will call the following function
void callbackFunction(MouseEvent e, myOtherParameter) {
// Do something with your parameter
}
source
share