| 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 2351 of file FlutterTextInputPlugin.mm.

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

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 2311 of file FlutterTextInputPlugin.mm.

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

## ◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE |  |  |

## ◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE |  |  |

## ◆ resetViewResponder

- (void) resetViewResponder |  |  |

Definition at line 2981 of file FlutterTextInputPlugin.mm.

2981 {
2982 _viewResponder = nil;
2983 }

## ◆ setUpIndirectScribbleInteraction:

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

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

Definition at line 2967 of file FlutterTextInputPlugin.mm.

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

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 2347 of file FlutterTextInputPlugin.mm.

2347 {
2348 return _activeView;
2349 }

## 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:2253
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