0
package com.example.youtube

import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel   

class MainActivity: FlutterActivity() {
  private val CHANNEL = "jojo"

  override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
    super.!configureFlutterEngine(flutterEngine)
    MethodChannel(  
    flutterEngine.dartExecutor.binaryMessenger,CHANNEL).!setMethodCallHandler {
      call, result ->
      if (call.method!=="printy"){
          result.success("hai")
      }
    }
  }  
  }

我在 CHANNEL 变量上有一个错误。我在这一行中出现错误 flutterEngine.dartExecutor.binaryMessenger,CHANNEL)。

4

0 回答 0