5package io.flutter.embedding.engine.systemchannels;
7import androidx.annotation.NonNull;
8import androidx.annotation.Nullable;
9import androidx.annotation.VisibleForTesting;
11import io.flutter.embedding.engine.dart.DartExecutor;
12import io.flutter.plugin.common.MethodCall;
13import io.flutter.plugin.common.MethodChannel;
14import io.flutter.plugin.common.StandardMethodCodec;
15import java.util.HashMap;
19 private static final String TAG =
"MouseCursorChannel";
34 this.mouseCursorMethodHandler = mouseCursorMethodHandler;
38 private final MethodChannel.MethodCallHandler parsingMethodCallHandler =
42 if (mouseCursorMethodHandler ==
null) {
48 final String method =
call.method;
49 Log.
v(TAG,
"Received '" + method +
"' message.");
53 case "activateSystemCursor":
54 @SuppressWarnings(
"unchecked")
55 final HashMap<String, Object>
data = (HashMap<String, Object>)
call.arguments;
56 final String kind = (String)
data.
get("kind");
58 mouseCursorMethodHandler.activateSystemCursor(kind);
59 }
catch (Exception
e) {
60 result.error(
"error",
"Error when setting cursors: " +
e.getMessage(),
null);
67 }
catch (Exception
e) {
68 result.error(
"error",
"Unhandled error: " +
e.getMessage(),
null);
75 parsingMethodCallHandler.onMethodCall(
call,
result);
static void v(@NonNull String tag, @NonNull String message)
void setMethodHandler(@Nullable MouseCursorMethodHandler mouseCursorMethodHandler)
void synthesizeMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result)
final MethodChannel channel
MouseCursorChannel(@NonNull DartExecutor dartExecutor)
void setMethodCallHandler(final @Nullable MethodCallHandler handler)
static final StandardMethodCodec INSTANCE
void activateSystemCursor(@NonNull String kind)
const myers::Point & get(const myers::Segment &)
std::shared_ptr< const fml::Mapping > data