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

Classes

interface  ProcessTextMethodHandler
 

Public Member Functions

 ProcessTextChannel ( @NonNull DartExecutor dartExecutor, @NonNull PackageManager packageManager)
 
void setMethodHandler (@Nullable ProcessTextMethodHandler processTextMethodHandler)
 

Public Attributes

final MethodChannel channel
 
final PackageManager packageManager
 
final MethodChannel.MethodCallHandler parsingMethodHandler
 

Detailed Description

ProcessTextChannel is a platform channel that is used by the framework to initiate text processing feature in the embedding and for the embedding to send back the results.

When the framework needs to query the list of text processing actions (for instance to expose them in the selected text context menu), it will send to the embedding the message
ProcessText.queryTextActions
. In response, the io.flutter.plugin.text.ProcessTextPlugin will return a map of all activities that can process text. The map keys are generated IDs and the values are the activities labels. On the first request, the io.flutter.plugin.text.ProcessTextPlugin will make a call to Android's package manager to query all activities that can be performed for the Intent.ACTION_PROCESS_TEXT intent.

When a text processing action has to be executed, the framework will send to the embedding the message ProcessText.processTextAction with the int id of the choosen text action and the String of text to process as arguments. In response, the io.flutter.plugin.text.ProcessTextPlugin will make a call to the Android application activity to start the activity exposing the text action. The io.flutter.plugin.text.ProcessTextPlugin will return the processed text if there is one, or null if the activity did not return a transformed text.

io.flutter.plugin.text.ProcessTextPlugin implements ProcessTextMethodHandler that parses incoming messages from Flutter.

Definition at line 40 of file ProcessTextChannel.java.

Constructor & Destructor Documentation

◆ ProcessTextChannel()

io.flutter.embedding.engine.systemchannels.ProcessTextChannel.ProcessTextChannel ( @NonNull DartExecutor  dartExecutor,
@NonNull PackageManager  packageManager 
)
inline

Definition at line 87 of file ProcessTextChannel.java.

88 {
89 this.packageManager = packageManager;
90 channel = new MethodChannel(dartExecutor, CHANNEL_NAME, StandardMethodCodec.INSTANCE);
92 }
void setMethodCallHandler(final @Nullable MethodCallHandler handler)

Member Function Documentation

◆ setMethodHandler()

void io.flutter.embedding.engine.systemchannels.ProcessTextChannel.setMethodHandler ( @Nullable ProcessTextMethodHandler  processTextMethodHandler)
inline

Sets the ProcessTextMethodHandler which receives all requests to the text processing feature sent through this channel.

Definition at line 98 of file ProcessTextChannel.java.

98 {
99 this.processTextMethodHandler = processTextMethodHandler;
100 }

Member Data Documentation

◆ channel

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

Definition at line 46 of file ProcessTextChannel.java.

◆ packageManager

final PackageManager io.flutter.embedding.engine.systemchannels.ProcessTextChannel.packageManager

Definition at line 47 of file ProcessTextChannel.java.

◆ parsingMethodHandler

final MethodChannel.MethodCallHandler io.flutter.embedding.engine.systemchannels.ProcessTextChannel.parsingMethodHandler

Definition at line 51 of file ProcessTextChannel.java.


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