Remove @NonNull
to avoid warning (#129472)
Otherwise android studio complains: > Do not use @NonNull in Kotlin; the nullability is already implied by the Kotlin type MethodCall not ending with ? 
This commit is contained in:
parent
bda64b54e1
commit
92969ba8ca
@ -16,12 +16,12 @@ class {{pluginClass}}: FlutterPlugin, MethodCallHandler {
|
||||
/// when the Flutter Engine is detached from the Activity
|
||||
private lateinit var channel : MethodChannel
|
||||
|
||||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "{{projectName}}")
|
||||
channel.setMethodCallHandler(this)
|
||||
}
|
||||
|
||||
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
|
||||
override fun onMethodCall(call: MethodCall, result: Result) {
|
||||
if (call.method == "getPlatformVersion") {
|
||||
result.success("Android ${android.os.Build.VERSION.RELEASE}")
|
||||
} else {
|
||||
@ -29,7 +29,7 @@ class {{pluginClass}}: FlutterPlugin, MethodCallHandler {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel.setMethodCallHandler(null)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user