5package io.flutter.embedding.engine.systemchannels;
7import androidx.annotation.NonNull;
8import androidx.annotation.Nullable;
10import io.flutter.embedding.engine.dart.DartExecutor;
11import io.flutter.plugin.common.MethodCall;
12import io.flutter.plugin.common.MethodChannel;
13import io.flutter.plugin.common.StandardMethodCodec;
14import java.util.ArrayList;
38 private static final String TAG =
"SpellCheckChannel";
45 new MethodChannel.MethodCallHandler() {
47 public void onMethodCall(@NonNull
MethodCall call, @NonNull MethodChannel.Result
result) {
48 if (spellCheckMethodHandler ==
null) {
51 "No SpellCheckeMethodHandler registered, call not forwarded to spell check API.");
54 String method = call.method;
55 Object
args = call.arguments;
56 Log.
v(
TAG,
"Received '" + method +
"' message.");
58 case "SpellCheck.initiateSpellCheck":
60 final ArrayList<String> argumentList = (ArrayList<String>)
args;
61 String locale = argumentList.get(0);
62 String
text = argumentList.get(1);
64 }
catch (IllegalStateException exception) {
65 result.error(
"error", exception.getMessage(),
null);
76 channel =
new MethodChannel(dartExecutor,
"flutter/spellcheck", StandardMethodCodec.INSTANCE);
86 this.spellCheckMethodHandler = spellCheckMethodHandler;
96 @NonNull String locale, @NonNull String
text, @NonNull MethodChannel.Result
result);
static void v(@NonNull String tag, @NonNull String message)
SpellCheckChannel(@NonNull DartExecutor dartExecutor)
void setSpellCheckMethodHandler( @Nullable SpellCheckMethodHandler spellCheckMethodHandler)
final MethodChannel.MethodCallHandler parsingMethodHandler
final MethodChannel channel
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
void initiateSpellCheck( @NonNull String locale, @NonNull String text, @NonNull MethodChannel.Result result)