replaces deprecated api usage for android (#62515)
This commit is contained in:
@@ -19,7 +19,7 @@ public class {{pluginClass}} implements FlutterPlugin, MethodCallHandler {
|
||||
|
||||
@Override
|
||||
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
|
||||
channel = new MethodChannel(flutterPluginBinding.getFlutterEngine().getDartExecutor(), "{{projectName}}");
|
||||
channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "{{projectName}}");
|
||||
channel.setMethodCallHandler(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package {{androidIdentifier}}
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.NonNull
|
||||
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
@@ -10,7 +10,7 @@ import io.flutter.plugin.common.MethodChannel.Result
|
||||
import io.flutter.plugin.common.PluginRegistry.Registrar
|
||||
|
||||
/** {{pluginClass}} */
|
||||
public class {{pluginClass}}: FlutterPlugin, MethodCallHandler {
|
||||
class {{pluginClass}}: FlutterPlugin, MethodCallHandler {
|
||||
/// The MethodChannel that will the communication between Flutter and native Android
|
||||
///
|
||||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
|
||||
@@ -18,8 +18,8 @@ public class {{pluginClass}}: FlutterPlugin, MethodCallHandler {
|
||||
private lateinit var channel : MethodChannel
|
||||
|
||||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel = MethodChannel(flutterPluginBinding.getFlutterEngine().getDartExecutor(), "{{projectName}}")
|
||||
channel.setMethodCallHandler(this);
|
||||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "{{projectName}}")
|
||||
channel.setMethodCallHandler(this)
|
||||
}
|
||||
|
||||
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
|
||||
|
||||
Reference in New Issue
Block a user