Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Public Attributes | List of all members
io.flutter.embedding.engine.systemchannels.KeyboardChannel Class Reference

Classes

interface  KeyboardMethodHandler
 

Public Member Functions

 KeyboardChannel (@NonNull BinaryMessenger messenger)
 
void setKeyboardMethodHandler (@Nullable KeyboardMethodHandler keyboardMethodHandler)
 

Public Attributes

final MethodChannel channel
 
final MethodChannel.MethodCallHandler parsingMethodHandler
 

Detailed Description

Event message channel for keyboard events to/from the Flutter framework.

Receives asynchronous messages from the framework to query the engine known pressed state.

Definition at line 21 of file KeyboardChannel.java.

Constructor & Destructor Documentation

◆ KeyboardChannel()

io.flutter.embedding.engine.systemchannels.KeyboardChannel.KeyboardChannel ( @NonNull BinaryMessenger  messenger)
inline

Definition at line 54 of file KeyboardChannel.java.

54 {
55 channel = new MethodChannel(messenger, "flutter/keyboard", StandardMethodCodec.INSTANCE);
57 }
final MethodChannel.MethodCallHandler parsingMethodHandler
void setMethodCallHandler(final @Nullable MethodCallHandler handler)

Member Function Documentation

◆ setKeyboardMethodHandler()

void io.flutter.embedding.engine.systemchannels.KeyboardChannel.setKeyboardMethodHandler ( @Nullable KeyboardMethodHandler  keyboardMethodHandler)
inline

Sets the KeyboardMethodHandler which receives all requests to query the keyboard state.

Definition at line 62 of file KeyboardChannel.java.

62 {
63 this.keyboardMethodHandler = keyboardMethodHandler;
64 }

Member Data Documentation

◆ channel

final MethodChannel io.flutter.embedding.engine.systemchannels.KeyboardChannel.channel

Definition at line 22 of file KeyboardChannel.java.

◆ parsingMethodHandler

final MethodChannel.MethodCallHandler io.flutter.embedding.engine.systemchannels.KeyboardChannel.parsingMethodHandler
Initial value:
=
new MethodChannel.MethodCallHandler() {
Map<Long, Long> pressedState = new HashMap<>();
@Override
public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
if (keyboardMethodHandler == null) {
result.success(pressedState);
} else {
switch (call.method) {
case "getKeyboardState":
try {
pressedState = keyboardMethodHandler.getKeyboardState();
} catch (IllegalStateException exception) {
result.error("error", exception.getMessage(), null);
}
result.success(pressedState);
break;
default:
result.notImplemented();
break;
}
}
}
}
static ::testing::Matcher< GBytes * > MethodCall(const std::string &name, ::testing::Matcher< FlValue * > args)
GAsyncResult * result
def call(args)
Definition: dom.py:159

Definition at line 26 of file KeyboardChannel.java.


The documentation for this class was generated from the following file: