setupCloseHandler method
Sets up the onWindowClose JavaScript handler
Implementation
void setupCloseHandler(
InAppWebViewController controller, VoidCallback onClose) {
controller.addJavaScriptHandler(
handlerName: 'onWindowClose',
callback: (args) async {
try {
onClose();
} catch (e) {
onClose();
}
},
);
}