import

io.flutter.plugin.common.MethodChannel

public

class

MainActivity

extends

FlutterActivity

private

static

final

String

CHANNEL

"samples.flutter.dev/battery"

@Override

public

void

configureFlutterEngine

@NonNull

FlutterEngine

flutterEngine

super

configureFlutterEngine

flutterEngine

);

new

MethodChannel

flutterEngine

getDartExecutor

().

getBinaryMessenger

(),

CHANNEL

setMethodCallHandler