setWindowSleepHandler method

  1. @override
void setWindowSleepHandler(
  1. Future<void> handler(
    1. String?
    )?
)
override

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;
  });
}