| Flutter iOS Embedder |

Instance Methods | Class Methods | Protected Attributes | Properties | List of all members
FlutterTextInputPlugin Class Reference

`#import <FlutterTextInputPlugin.h>`

## Instance Methods
(instancetype) | - NS_UNAVAILABLE
(instancetype) | - initWithDelegate:
(void) | - handleMethodCall:result:
(UIView< UITextInput > *) | - textInputView
(void) | - setUpIndirectScribbleInteraction:
(void) | - resetViewResponder

## Class Methods
(instancetype) | + NS_UNAVAILABLE

## Protected Attributes
| __pad0__: NSObject <FlutterKeySecondaryResponder

## Properties
UIIndirectScribbleInteractionDelegate UIViewController * | viewController
id< FlutterIndirectScribbleDelegate > | indirectScribbleDelegate
NSMutableDictionary< UIScribbleElementIdentifier, NSValue * > * | scribbleElements

## Detailed Description

Definition at line 33 of file FlutterTextInputPlugin.h.

## Method Documentation

## ◆ handleMethodCall:result:

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

Definition at line 2356 of file FlutterTextInputPlugin.mm.

2356 :(FlutterMethodCall*)call result:(FlutterResult)result {
2357 NSString* method = call.method;
2358 id args = call.arguments;
2359 if ([method isEqualToString:kShowMethod]) {
2360 [self showTextInput];
2361 result(nil);
2362 } else if ([method isEqualToString:kHideMethod]) {
2363 [self hideTextInput];
2364 result(nil);
2365 } else if ([method isEqualToString:kSetClientMethod]) {
2366 [self setTextInputClient:[args[0] intValue] withConfiguration:args[1]];
2367 result(nil);
2368 } else if ([method isEqualToString:kSetPlatformViewClientMethod]) {
2369 // This method call has a `platformViewId` argument, but we do not need it for iOS for now.
2370 [self setPlatformViewTextInputClient];
2371 result(nil);
2372 } else if ([method isEqualToString:kSetEditingStateMethod]) {
2373 [self setTextInputEditingState:args];
2374 result(nil);
2375 } else if ([method isEqualToString:kClearClientMethod]) {
2376 [self clearTextInputClient];
2377 result(nil);
2378 } else if ([method isEqualToString:kSetEditableSizeAndTransformMethod]) {
2379 [self setEditableSizeAndTransform:args];
2380 result(nil);
2381 } else if ([method isEqualToString:kSetMarkedTextRectMethod]) {
2382 [self updateMarkedRect:args];
2383 result(nil);
2384 } else if ([method isEqualToString:kFinishAutofillContextMethod]) {
2385 [self triggerAutofillSave:[args boolValue]];
2386 result(nil);
2387 // TODO(justinmc): Remove the TextInput method constant when the framework has
2388 // finished transitioning to using the Scribble channel.
2389 // https://github.com/flutter/flutter/pull/104128
2390 } else if ([method isEqualToString:kDeprecatedSetSelectionRectsMethod]) {
2391 [self setSelectionRects:args];
2392 result(nil);
2393 } else if ([method isEqualToString:kSetSelectionRectsMethod]) {
2394 [self setSelectionRects:args];
2395 result(nil);
2396 } else if ([method isEqualToString:kStartLiveTextInputMethod]) {
2397 [self startLiveTextInput];
2398 result(nil);
2399 } else if ([method isEqualToString:kUpdateConfigMethod]) {
2400 [self updateConfig:args];
2401 result(nil);
2402 } else if ([method isEqualToString:kOnInteractiveKeyboardPointerMoveMethod]) {
2403 CGFloat pointerY = (CGFloat)[args[@"pointerY"] doubleValue];
2404 [self handlePointerMove:pointerY];
2405 result(nil);
2406 } else if ([method isEqualToString:kOnInteractiveKeyboardPointerUpMethod]) {
2407 CGFloat pointerY = (CGFloat)[args[@"pointerY"] doubleValue];
2408 [self handlePointerUp:pointerY];
2409 result(nil);
2410 } else {
2411 result(FlutterMethodNotImplemented);
2412 }
2413 }

References FlutterMethodCall::arguments, FlutterMethodNotImplemented, kClearClientMethod, kDeprecatedSetSelectionRectsMethod, kFinishAutofillContextMethod, kHideMethod, kOnInteractiveKeyboardPointerMoveMethod, kOnInteractiveKeyboardPointerUpMethod, kSetClientMethod, kSetEditableSizeAndTransformMethod, kSetEditingStateMethod, kSetMarkedTextRectMethod, kSetPlatformViewClientMethod, kSetSelectionRectsMethod, kShowMethod, kStartLiveTextInputMethod, kUpdateConfigMethod, and FlutterMethodCall::method.

## ◆ initWithDelegate:

- (instancetype) initWithDelegate: |  | (id<FlutterTextInputDelegate>) | NS_DESIGNATED_INITIALIZER |

Initial value:
{
NSTimer* _enableFlutterTextInputViewAccessibilityTimer

Definition at line 2316 of file FlutterTextInputPlugin.mm.

2316 :(id<FlutterTextInputDelegate>)textInputDelegate {
2317 self = [super init];
2318 if (self) {
2319 // `_textInputDelegate` is a weak reference because it should retain FlutterTextInputPlugin.
2320 _textInputDelegate = textInputDelegate;
2321 _autofillContext = [[NSMutableDictionary alloc] init];
2322 _inputHider = [[FlutterTextInputViewAccessibilityHider alloc] init];
2323 _scribbleElements = [[NSMutableDictionary alloc] init];
2324 _keyboardViewContainer = [[UIView alloc] init];
2325
2326 [[NSNotificationCenter defaultCenter] addObserver:self
2327 selector:@selector(handleKeyboardWillShow:)
2328 name:UIKeyboardWillShowNotification
2329 object:nil];
2330 }
2331
2332 return self;
2333 }

## ◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE |  |  |

## ◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE |  |  |

## ◆ resetViewResponder

- (void) resetViewResponder |  |  |

Definition at line 2986 of file FlutterTextInputPlugin.mm.

2986 {
2987 _viewResponder = nil;
2988 }

## ◆ setUpIndirectScribbleInteraction:

- (void) setUpIndirectScribbleInteraction: |  | (id<FlutterViewResponder>) | viewResponder |

These are used by the UIIndirectScribbleInteractionDelegate methods to handle focusing on the correct element.

Definition at line 2972 of file FlutterTextInputPlugin.mm.

2972 :(id<FlutterViewResponder>)viewResponder {
2973 if (_viewResponder != viewResponder) {
2974 if (@available(iOS 14.0, *)) {
2975 UIView* parentView = viewResponder.view;
2976 if (parentView != nil) {
2977 UIIndirectScribbleInteraction* scribbleInteraction = [[UIIndirectScribbleInteraction alloc]
2978 initWithDelegate:(id<UIIndirectScribbleInteractionDelegate>)self];
2979 [parentView addInteraction:scribbleInteraction];
2980 }
2981 }
2982 }
2983 _viewResponder = viewResponder;
2984 }

References viewResponder.

## ◆ 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 2352 of file FlutterTextInputPlugin.mm.

2352 {
2353 return _activeView;
2354 }

## Member Data Documentation

## ◆ __pad0__

- __pad0__
| protected

Definition at line 34 of file FlutterTextInputPlugin.h.

## Property Documentation

## ◆ indirectScribbleDelegate

- (id<FlutterIndirectScribbleDelegate>) indirectScribbleDelegate
| read write nonatomic weak

Definition at line 37 of file FlutterTextInputPlugin.h.

## ◆ scribbleElements

- (NSMutableDictionary<UIScribbleElementIdentifier, NSValue*>*) scribbleElements
| read write nonatomic strong

Definition at line 39 of file FlutterTextInputPlugin.h.

## ◆ viewController

- (UIIndirectScribbleInteractionDelegate UIViewController*) viewController
| read write nonatomic weak

Definition at line 36 of file FlutterTextInputPlugin.h.

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

- shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h
- shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm

kSetEditingStateMethod
static NSString *const kSetEditingStateMethod
Definition: FlutterTextInputPlugin.mm:43
FlutterMethodNotImplemented
FLUTTER_DARWIN_EXPORT NSObject const * FlutterMethodNotImplemented
kOnInteractiveKeyboardPointerUpMethod
static NSString *const kOnInteractiveKeyboardPointerUpMethod
Definition: FlutterTextInputPlugin.mm:58
kSetClientMethod
static NSString *const kSetClientMethod
Definition: FlutterTextInputPlugin.mm:41
kUpdateConfigMethod
static NSString *const kUpdateConfigMethod
Definition: FlutterTextInputPlugin.mm:55
FlutterMethodCall::method
NSString * method
Definition: FlutterCodecs.h:233
kSetPlatformViewClientMethod
static NSString *const kSetPlatformViewClientMethod
Definition: FlutterTextInputPlugin.mm:42
kSetEditableSizeAndTransformMethod
static NSString *const kSetEditableSizeAndTransformMethod
Definition: FlutterTextInputPlugin.mm:45
kClearClientMethod
static NSString *const kClearClientMethod
Definition: FlutterTextInputPlugin.mm:44
kStartLiveTextInputMethod
static NSString *const kStartLiveTextInputMethod
Definition: FlutterTextInputPlugin.mm:54
kDeprecatedSetSelectionRectsMethod
static NSString *const kDeprecatedSetSelectionRectsMethod
Definition: FlutterTextInputPlugin.mm:52
FlutterMethodCall
Definition: FlutterCodecs.h:220
FlutterResult
void(^ FlutterResult)(id _Nullable result)
Definition: FlutterChannels.h:194
kOnInteractiveKeyboardPointerMoveMethod
static NSString *const kOnInteractiveKeyboardPointerMoveMethod
Definition: FlutterTextInputPlugin.mm:56
FlutterTextInputViewAccessibilityHider
Definition: FlutterTextInputPlugin.mm:2258
viewResponder
id< FlutterViewResponder > viewResponder
Definition: FlutterTextInputPlugin.h:158
kFinishAutofillContextMethod
static NSString *const kFinishAutofillContextMethod
Definition: FlutterTextInputPlugin.mm:48
kShowMethod
static NSString *const kShowMethod
Definition: FlutterTextInputPlugin.mm:39
kHideMethod
static NSString *const kHideMethod
Definition: FlutterTextInputPlugin.mm:40
kSetMarkedTextRectMethod
static NSString *const kSetMarkedTextRectMethod
Definition: FlutterTextInputPlugin.mm:47
kSetSelectionRectsMethod
static NSString *const kSetSelectionRectsMethod
Definition: FlutterTextInputPlugin.mm:53
FlutterMethodCall::arguments
id arguments
Definition: FlutterCodecs.h:238