Catch-all commit for outstanding pre-existing local changes. Mixes several themes that would normally be split: - Rename: UxPlugin → XPlugin across iOS, macOS, Android registrants. - New top-level packages under lib/src/: anim/ (animated values, panes, sheets, dock, measured), core/ (Emitter, ReactiveBuilder scaffolding, presenter/widget/value/dispose primitives), navi/ (Screen/ScreenStack/Router/hero/transitions), reactive/. - Edits across existing plugins (clipboard, crash, file, gallery, keyboard, scanner, sensor, url) to align with the new core. - Test updates and CHANGELOG/README touches accompanying the above.
24 lines
721 B
Swift
24 lines
721 B
Swift
import Flutter
|
|
import UIKit
|
|
|
|
public protocol NativePlugin {
|
|
func register(with registrar: FlutterPluginRegistrar)
|
|
}
|
|
|
|
public enum XWindow {
|
|
public static var keyWindow: UIWindow? {
|
|
if let w = UIApplication.shared.delegate?.window ?? nil { return w }
|
|
for scene in UIApplication.shared.connectedScenes {
|
|
guard let ws = scene as? UIWindowScene else { continue }
|
|
for window in ws.windows where window.isKeyWindow { return window }
|
|
}
|
|
return nil
|
|
}
|
|
|
|
public static var topViewController: UIViewController? {
|
|
var vc = keyWindow?.rootViewController
|
|
while let presented = vc?.presentedViewController { vc = presented }
|
|
return vc
|
|
}
|
|
}
|