5package io.flutter.embedding.engine.systemchannels;
7import androidx.annotation.NonNull;
8import androidx.annotation.Nullable;
9import io.flutter.plugin.common.BinaryMessenger;
10import io.flutter.plugin.common.MethodCall;
11import io.flutter.plugin.common.MethodChannel;
12import io.flutter.plugin.common.StandardMethodCodec;
13import java.util.HashMap;
27 new MethodChannel.MethodCallHandler() {
28 Map<Long, Long> pressedState =
new HashMap<>();
31 public void onMethodCall(@NonNull
MethodCall call, @NonNull MethodChannel.Result
result) {
32 if (keyboardMethodHandler ==
null) {
35 result.success(pressedState);
37 switch (call.method) {
38 case "getKeyboardState":
41 }
catch (IllegalStateException exception) {
42 result.error(
"error", exception.getMessage(),
null);
44 result.success(pressedState);
55 channel =
new MethodChannel(messenger,
"flutter/keyboard", StandardMethodCodec.INSTANCE);
63 this.keyboardMethodHandler = keyboardMethodHandler;
KeyboardChannel(@NonNull BinaryMessenger messenger)
final MethodChannel channel
final MethodChannel.MethodCallHandler parsingMethodHandler
void setKeyboardMethodHandler(@Nullable KeyboardMethodHandler keyboardMethodHandler)
Map< Long, Long > getKeyboardState()