From f00d8f14ad56a0e002eb654bc5d3878a802617a4 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Thu, 25 Aug 2022 11:25:01 +0200 Subject: [PATCH] added missing file --- lib/native_events/window_focus.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/native_events/window_focus.dart diff --git a/lib/native_events/window_focus.dart b/lib/native_events/window_focus.dart new file mode 100644 index 0000000..9de8cbf --- /dev/null +++ b/lib/native_events/window_focus.dart @@ -0,0 +1,16 @@ +import 'package:flutter/services.dart'; + +class EventChannelWindowFocus { + static const MethodChannel _channel = + const MethodChannel('floss.myzel394.quid_faciam_hodie/window_focus'); + + static void setGlobalListener(void Function(bool) listener) { + _channel.setMethodCallHandler((call) async { + if (call.method == 'windowFocusChanged') { + listener(call.arguments as bool); + } + + return null; + }); + } +}