dev
swift 19 lines 619 Bytes
Raw
1 import Flutter
2 import UIKit
3
4 public class CwDecredPlugin: NSObject, FlutterPlugin {
5 public static func register(with registrar: FlutterPluginRegistrar) {
6 let channel = FlutterMethodChannel(name: "cw_decred", binaryMessenger: registrar.messenger())
7 let instance = CwDecredPlugin()
8 registrar.addMethodCallDelegate(instance, channel: channel)
9 }
10
11 public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
12 switch call.method {
13 case "getPlatformVersion":
14 result("iOS " + UIDevice.current.systemVersion)
15 default:
16 result(FlutterMethodNotImplemented)
17 }
18 }
19 }