public

void

onAttachedToEngine

@NonNull

FlutterPluginBinding

binding

BinaryMessenger

messenger

binding

getBinaryMessenger

();

BinaryMessenger

TaskQueue

taskQueue

messenger

makeBackgroundTaskQueue

();

channel

new

MethodChannel

messenger

"com.example.foo"

StandardMethodCodec

INSTANCE

taskQueue

);

channel

setMethodCallHandler

this

);

In Kotlin:

override

fun

onAttachedToEngine