Flutter Engine
FlutterTextInputPlugin Class Reference

#import <FlutterTextInputPlugin.h>

Inheritance diagram for FlutterTextInputPlugin:

Instance Methods

(void) - handleMethodCall:result:
 
(UIView< UITextInput > *) - textInputView
 
(instancetype) - initWithViewController:
 

Properties

id< FlutterTextInputDelegate > textInputDelegate
 

Detailed Description

A plugin to handle text input.

Responsible for bridging the native macOS text input system with the Flutter framework text editing classes, via system channels.

This is not an FlutterPlugin since it needs access to FlutterViewController internals, so needs to be managed differently.

Definition at line 13 of file FlutterTextInputPlugin.h.

Method Documentation

◆ handleMethodCall:result:()

- (void) handleMethodCall: (FlutterMethodCall*)  call
result: (FlutterResult result 

Definition at line 1162 of file FlutterTextInputPlugin.mm.

References args, FlutterMethodCall::arguments, autofillIdFromDictionary(), autofillTypeOf(), FlutterMethodNotImplemented, kAssociatedAutofillFields, kInvalidFirstRect, FlutterMethodCall::method, and FlutterTextInputView::textInputDelegate.

Referenced by FlutterEngine::destroyContext.

1162  :(FlutterMethodCall*)call result:(FlutterResult)result {
1163  NSString* method = call.method;
1164  id args = call.arguments;
1165  if ([method isEqualToString:@"TextInput.show"]) {
1166  [self showTextInput];
1167  result(nil);
1168  } else if ([method isEqualToString:@"TextInput.hide"]) {
1169  [self hideTextInput];
1170  result(nil);
1171  } else if ([method isEqualToString:@"TextInput.setClient"]) {
1172  [self setTextInputClient:[args[0] intValue] withConfiguration:args[1]];
1173  result(nil);
1174  } else if ([method isEqualToString:@"TextInput.setEditingState"]) {
1175  [self setTextInputEditingState:args];
1176  result(nil);
1177  } else if ([method isEqualToString:@"TextInput.clearClient"]) {
1178  [self clearTextInputClient];
1179  result(nil);
1180  } else if ([method isEqualToString:@"TextInput.setEditableSizeAndTransform"]) {
1181  [self setEditableSizeAndTransform:args];
1182  result(nil);
1183  } else if ([method isEqualToString:@"TextInput.setMarkedTextRect"]) {
1184  [self updateMarkedRect:args];
1185  result(nil);
1186  } else if ([method isEqualToString:@"TextInput.finishAutofillContext"]) {
1187  [self triggerAutofillSave:[args boolValue]];
1188  result(nil);
1189  } else {
1191  }
1192 }
G_BEGIN_DECLS FlValue * args
void(^ FlutterResult)(id _Nullable result)
FLUTTER_EXPORT NSObject const * FlutterMethodNotImplemented

◆ initWithViewController:()

- (instancetype) initWithViewController: (FlutterViewController*)  viewController

Initializes a text input plugin that coordinates key event handling with |viewController|.

Definition at line 59 of file FlutterTextInputPlugin.mm.

References _channel, FlutterMethodCall::arguments, FlutterMethodNotImplemented, id, kClearClientMethod, kHideMethod, kMultilineInputType, kSetClientMethod, kSetEditingStateMethod, kShowMethod, length, FlutterMethodCall::method, and FlutterMethodChannel::methodChannelWithName:binaryMessenger:codec:.

59  :(FlutterViewController*)viewController {
60  self = [super init];
61  if (self != nil) {
62  _flutterViewController = viewController;
64  binaryMessenger:viewController.engine.binaryMessenger
65  codec:[FlutterJSONMethodCodec sharedInstance]];
66  __weak FlutterTextInputPlugin* weakSelf = self;
67  [_channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) {
68  [weakSelf handleMethodCall:call result:result];
69  }];
70  _textInputContext = [[NSTextInputContext alloc] initWithClient:self];
71  }
72  return self;
73 }
FlutterMethodChannel * _channel
instancetype methodChannelWithName:binaryMessenger:codec:(NSString *name, [binaryMessenger] NSObject< FlutterBinaryMessenger > *messenger, [codec] NSObject< FlutterMethodCodec > *codec)

◆ textInputView()

- (UIView< UITextInput > *) textInputView

The UITextInput implementation used to control text entry.

This is used by AccessibilityBridge to forward interactions with iOS' accessibility system.

Definition at line 1158 of file FlutterTextInputPlugin.mm.

1158  {
1159  return _activeView;
1160 }

Property Documentation

◆ textInputDelegate

- (id<FlutterTextInputDelegate>) textInputDelegate
readwritenonatomicassign

Definition at line 15 of file FlutterTextInputPlugin.h.


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