5package io.flutter.embedding.engine.systemchannels;
7import android.content.pm.PackageManager;
8import androidx.annotation.NonNull;
9import 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;
41 private static final String TAG =
"ProcessTextChannel";
42 private static final String CHANNEL_NAME =
"flutter/processtext";
43 private static final String METHOD_QUERY_TEXT_ACTIONS =
"ProcessText.queryTextActions";
44 private static final String METHOD_PROCESS_TEXT_ACTION =
"ProcessText.processTextAction";
55 if (processTextMethodHandler ==
null) {
58 String method =
call.method;
61 case METHOD_QUERY_TEXT_ACTIONS:
65 }
catch (IllegalStateException exception) {
66 result.error(
"error", exception.getMessage(),
null);
69 case METHOD_PROCESS_TEXT_ACTION:
71 final ArrayList<Object> argumentList = (ArrayList<Object>)
args;
72 String
id = (String) (argumentList.get(0));
73 String
text = (String) (argumentList.get(1));
74 boolean readOnly = (boolean) (argumentList.get(2));
76 }
catch (IllegalStateException exception) {
77 result.error(
"error", exception.getMessage(),
null);
99 this.processTextMethodHandler = processTextMethodHandler;
118 @NonNull String input,
119 @NonNull
boolean readOnly,
void setMethodHandler(@Nullable ProcessTextMethodHandler processTextMethodHandler)
final MethodChannel.MethodCallHandler parsingMethodHandler
ProcessTextChannel( @NonNull DartExecutor dartExecutor, @NonNull PackageManager packageManager)
final MethodChannel channel
final PackageManager packageManager
void setMethodCallHandler(final @Nullable MethodCallHandler handler)
static final StandardMethodCodec INSTANCE
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
void processTextAction( @NonNull String id, @NonNull String input, @NonNull boolean readOnly, @NonNull MethodChannel.Result result)
Map< String, String > queryTextActions()