| package {{androidIdentifier}} |
| |
| import io.flutter.plugin.common.MethodCall |
| import io.flutter.plugin.common.MethodChannel |
| import io.flutter.plugin.common.MethodChannel.MethodCallHandler |
| import io.flutter.plugin.common.MethodChannel.Result |
| import io.flutter.plugin.common.PluginRegistry.Registrar |
| |
| class {{pluginClass}}: MethodCallHandler { |
| companion object { |
| @JvmStatic |
| fun registerWith(registrar: Registrar) { |
| val channel = MethodChannel(registrar.messenger(), "{{projectName}}") |
| channel.setMethodCallHandler({{pluginClass}}()) |
| } |
| } |
| |
| override fun onMethodCall(call: MethodCall, result: Result) { |
| if (call.method == "getPlatformVersion") { |
| result.success("Android ${android.os.Build.VERSION.RELEASE}") |
| } else { |
| result.notImplemented() |
| } |
| } |
| } |