Files
ux/macos/Classes/XPlugin.swift
agra 76621a4132 window: extract XWindow primitive; XNotifications stops carrying focus
The window-focus signal had no business living on the notifications
primitive — it was there because the same NotificationsPlugin happened
to observe NSApplication active/resign for its own reasons. Splitting
it into a sibling XWindow primitive (with its own WindowPlugin on
macOS, ux/window/events) lets future consumers — paused video,
deferred-work scheduling, dock badge counts — read focus state without
pulling in UNUserNotificationCenter.

XNotifications now only exposes notification I/O (show/cancel + tap +
authorization). The 'type:focus' event-channel branch is gone.
2026-05-27 14:42:39 +03:00

27 lines
708 B
Swift

import FlutterMacOS
import AppKit
public class XPlugin: NSObject, FlutterPlugin {
private static var plugins: [NativePlugin] = []
public static func register(with registrar: FlutterPluginRegistrar) {
plugins = [
FilePlugin(),
ClipboardPlugin(),
GalleryPlugin(),
CameraPlugin(),
UxVideoPlayerPlugin(),
UrlPlugin(),
NotificationsPlugin(),
WindowPlugin(),
]
for plugin in plugins {
plugin.register(with: registrar)
}
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
result(FlutterMethodNotImplemented)
}
}