mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 05:27:23 +00:00
20 lines
652 B
Swift
20 lines
652 B
Swift
import Cocoa
|
|
import FlutterMacOS
|
|
|
|
public class FlutterQjsPlugin: NSObject, FlutterPlugin {
|
|
public static func register(with registrar: FlutterPluginRegistrar) {
|
|
let channel = FlutterMethodChannel(name: "flutter_qjs", binaryMessenger: registrar.messenger)
|
|
let instance = FlutterQjsPlugin()
|
|
registrar.addMethodCallDelegate(instance, channel: channel)
|
|
}
|
|
|
|
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
switch call.method {
|
|
case "getPlatformVersion":
|
|
result("macOS " + ProcessInfo.processInfo.operatingSystemVersionString)
|
|
default:
|
|
result(FlutterMethodNotImplemented)
|
|
}
|
|
}
|
|
}
|