android flutter plugin
This commit is contained in:
@@ -14,22 +14,22 @@ class VeilidPlugin: FlutterPlugin, MethodCallHandler {
|
||||
///
|
||||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
|
||||
/// when the Flutter Engine is detached from the Activity
|
||||
private lateinit var channel : MethodChannel
|
||||
// private lateinit var channel : MethodChannel
|
||||
|
||||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "veilid")
|
||||
channel.setMethodCallHandler(this)
|
||||
// channel = MethodChannel(flutterPluginBinding.binaryMessenger, "veilid")
|
||||
// channel.setMethodCallHandler(this)
|
||||
}
|
||||
|
||||
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
|
||||
if (call.method == "getPlatformVersion") {
|
||||
result.success("Android ${android.os.Build.VERSION.RELEASE}")
|
||||
} else {
|
||||
result.notImplemented()
|
||||
}
|
||||
// if (call.method == "getPlatformVersion") {
|
||||
// result.success("Android ${android.os.Build.VERSION.RELEASE}")
|
||||
// } else {
|
||||
result.notImplemented()
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel.setMethodCallHandler(null)
|
||||
// channel.setMethodCallHandler(null)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user