quid_faciam_hodie/lib/native_events/window_focus.dart
2022-08-25 11:25:01 +02:00

17 lines
436 B
Dart

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