setWindowSleepHandler method
Implementation
@override
void setWindowSleepHandler(Future<void> Function(String?)? handler) {
methodChannel.setMethodCallHandler((call) async {
if (call.method == 'onWindowsSleep') {
// Note: the 'destroyWindow' method just close the window without
// any confirming.
if (handler != null) {
await handler(call.arguments);
}
}
return null;
});
}