feat: add support for Flutter Linux, macOS and Windows (#10)

This commit is contained in:
Aleksey Kulikov 2021-10-30 13:54:25 +03:00 committed by GitHub
parent a71bb14b86
commit c8895524be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 401 additions and 18 deletions

View file

@ -0,0 +1,19 @@
import Cocoa
import FlutterMacOS
public class Libgit2dartPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "libgit2dart", binaryMessenger: registrar.messenger)
let instance = Libgit2dartPlugin()
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)
}
}
}