| 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:
(void) | - reset
(UIView< UITextInput > *) | - textInputView
(void) | - setUpIndirectScribbleInteraction:
(void) | - resetViewResponder
(BOOL) | - showEditMenu:
(ios(16.0) | - API_AVAILABLE

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

## ◆ API_AVAILABLE

- (ios(16.0) API_AVAILABLE |  |  |

## ◆ handleMethodCall:result:

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

Definition at line 2509 of file FlutterTextInputPlugin.mm.

2560 :(FlutterMethodCall*)call result:(FlutterResult)result {
2561 NSString* method = call.method;
2562 id args = call.arguments;
2563 if ([method isEqualToString:kShowMethod]) {
2564 [self showTextInput];
2565 result(nil);
2566 } else if ([method isEqualToString:kHideMethod]) {
2567 [self hideTextInput];
2568 result(nil);
2569 } else if ([method isEqualToString:kSetClientMethod]) {
2570 [self setTextInputClient:[args[0] intValue] withConfiguration:args[1]];
2571 result(nil);
2572 } else if ([method isEqualToString:kSetPlatformViewClientMethod]) {
2573 // This method call has a `platformViewId` argument, but we do not need it for iOS for now.
2574 [self setPlatformViewTextInputClient];
2575 result(nil);
2576 } else if ([method isEqualToString:kSetEditingStateMethod]) {
2577 [self setTextInputEditingState:args];
2578 result(nil);
2579 } else if ([method isEqualToString:kClearClientMethod]) {
2580 [self clearTextInputClient];
2581 result(nil);
2582 } else if ([method isEqualToString:kSetEditableSizeAndTransformMethod]) {
2583 [self setEditableSizeAndTransform:args];
2584 result(nil);
2585 } else if ([method isEqualToString:kSetMarkedTextRectMethod]) {
2586 [self updateMarkedRect:args];
2587 result(nil);
2588 } else if ([method isEqualToString:kFinishAutofillContextMethod]) {
2589 [self triggerAutofillSave:[args boolValue]];
2590 result(nil);
2591 // TODO(justinmc): Remove the TextInput method constant when the framework has
2592 // finished transitioning to using the Scribble channel.
2593 // https://github.com/flutter/flutter/pull/104128
2594 } else if ([method isEqualToString:kDeprecatedSetSelectionRectsMethod]) {
2595 [self setSelectionRects:args];
2596 result(nil);
2597 } else if ([method isEqualToString:kSetSelectionRectsMethod]) {
2598 [self setSelectionRects:args];
2599 result(nil);
2600 } else if ([method isEqualToString:kStartLiveTextInputMethod]) {
2601 [self startLiveTextInput];
2602 result(nil);
2603 } else if ([method isEqualToString:kUpdateConfigMethod]) {
2604 [self updateConfig:args];
2605 result(nil);
2606 } else if ([method isEqualToString:kOnInteractiveKeyboardPointerMoveMethod]) {
2607 CGFloat pointerY = (CGFloat)[args[@"pointerY"] doubleValue];
2608 [self handlePointerMove:pointerY];
2609 result(nil);
2610 } else if ([method isEqualToString:kOnInteractiveKeyboardPointerUpMethod]) {
2611 CGFloat pointerY = (CGFloat)[args[@"pointerY"] doubleValue];
2612 [self handlePointerUp:pointerY];
2613 result(nil);
2614 } else {
2615 result(FlutterMethodNotImplemented);
2616 }
2617 }
FlutterResult
void(^ FlutterResult)(id _Nullable result)
Definition: FlutterChannels.h:194
FlutterMethodNotImplemented
FLUTTER_DARWIN_EXPORT NSObject const * FlutterMethodNotImplemented
kSetMarkedTextRectMethod
static NSString *const kSetMarkedTextRectMethod
Definition: FlutterTextInputPlugin.mm:49
kFinishAutofillContextMethod
static NSString *const kFinishAutofillContextMethod
Definition: FlutterTextInputPlugin.mm:50
kShowMethod
static NSString *const kShowMethod
Definition: FlutterTextInputPlugin.mm:41
kUpdateConfigMethod
static NSString *const kUpdateConfigMethod
Definition: FlutterTextInputPlugin.mm:57
kSetSelectionRectsMethod
static NSString *const kSetSelectionRectsMethod
Definition: FlutterTextInputPlugin.mm:55
kSetPlatformViewClientMethod
static NSString *const kSetPlatformViewClientMethod
Definition: FlutterTextInputPlugin.mm:44
kSetEditingStateMethod
static NSString *const kSetEditingStateMethod
Definition: FlutterTextInputPlugin.mm:45
kOnInteractiveKeyboardPointerUpMethod
static NSString *const kOnInteractiveKeyboardPointerUpMethod
Definition: FlutterTextInputPlugin.mm:60
kClearClientMethod
static NSString *const kClearClientMethod
Definition: FlutterTextInputPlugin.mm:46
kSetClientMethod
static NSString *const kSetClientMethod
Definition: FlutterTextInputPlugin.mm:43
kStartLiveTextInputMethod
static NSString *const kStartLiveTextInputMethod
Definition: FlutterTextInputPlugin.mm:56
kDeprecatedSetSelectionRectsMethod
static NSString *const kDeprecatedSetSelectionRectsMethod
Definition: FlutterTextInputPlugin.mm:54
kHideMethod
static NSString *const kHideMethod
Definition: FlutterTextInputPlugin.mm:42
kSetEditableSizeAndTransformMethod
static NSString *const kSetEditableSizeAndTransformMethod
Definition: FlutterTextInputPlugin.mm:47
kOnInteractiveKeyboardPointerMoveMethod
static NSString *const kOnInteractiveKeyboardPointerMoveMethod
Definition: FlutterTextInputPlugin.mm:58
FlutterMethodCall
Definition: FlutterCodecs.h:221
FlutterMethodCall::method
NSString * method
Definition: FlutterCodecs.h:233
FlutterMethodCall::arguments
id arguments
Definition: FlutterCodecs.h:238

## ◆ initWithDelegate:

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

Initial value:
{
NSTimer* _enableFlutterTextInputViewAccessibilityTimer

Definition at line 2509 of file FlutterTextInputPlugin.mm.

2516 :(id<FlutterTextInputDelegate>)textInputDelegate {
2517 self = [super init];
2518 if (self) {
2519 // `_textInputDelegate` is a weak reference because it should retain FlutterTextInputPlugin.
2520 _textInputDelegate = textInputDelegate;
2521 _autofillContext = [[NSMutableDictionary alloc] init];
2522 _inputHider = [[FlutterTextInputViewAccessibilityHider alloc] init];
2523 _scribbleElements = [[NSMutableDictionary alloc] init];
2524 _keyboardViewContainer = [[UIView alloc] init];
2525
2526 [[NSNotificationCenter defaultCenter] addObserver:self
2527 selector:@selector(handleKeyboardWillShow:)
2528 name:UIKeyboardWillShowNotification
2529 object:nil];
2530 }
2531
2532 return self;
2533 }
FlutterTextInputViewAccessibilityHider
Definition: FlutterTextInputPlugin.mm:2458

## ◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE |  |  |

## ◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE |  |  |

## ◆ reset

- (void) reset |  |  |

Reset the text input plugin to prepare for a hot restart.

This hides the software keyboard and text editing context menu.

Definition at line 2509 of file FlutterTextInputPlugin.mm.

2556 {
2557 [self hideTextInput];
2558 }

## ◆ resetViewResponder

- (void) resetViewResponder |  |  |

Definition at line 2509 of file FlutterTextInputPlugin.mm.

3215 {
3216 _viewResponder = nil;
3217 }

## ◆ setUpIndirectScribbleInteraction:

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

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

Definition at line 2509 of file FlutterTextInputPlugin.mm.

3201 :(id<FlutterViewResponder>)viewResponder {
3202 if (_viewResponder != viewResponder) {
3203 if (@available(iOS 14.0, *)) {
3204 UIView* parentView = viewResponder.view;
3205 if (parentView != nil) {
3206 UIIndirectScribbleInteraction* scribbleInteraction = [[UIIndirectScribbleInteraction alloc]
3207 initWithDelegate:(id<UIIndirectScribbleInteractionDelegate>)self];
3208 [parentView addInteraction:scribbleInteraction];
3209 }
3210 }
3211 }
3212 _viewResponder = viewResponder;
3213 }
viewResponder
id< FlutterViewResponder > viewResponder
Definition: FlutterTextInputPlugin.h:168

## ◆ showEditMenu:

- (BOOL) showEditMenu: |  | (ios(16.0)) | API_AVAILABLE |

Definition at line 2509 of file FlutterTextInputPlugin.mm.

2731 :(NSDictionary*)args API_AVAILABLE(ios(16.0)) {
2732 if (!self.activeView.isFirstResponder) {
2733 return NO;
2734 }
2735 NSDictionary<NSString*, NSNumber*>* encodedTargetRect = args[@"targetRect"];
2736 CGRect globalTargetRect = CGRectMake(
2737 [encodedTargetRect[@"x"] doubleValue], [encodedTargetRect[@"y"] doubleValue],
2738 [encodedTargetRect[@"width"] doubleValue], [encodedTargetRect[@"height"] doubleValue]);
2739 CGRect localTargetRect = [self.hostView convertRect:globalTargetRect toView:self.activeView];
2740 [self.activeView showEditMenuWithTargetRect:localTargetRect items:args[@"items"]];
2741 return YES;
2742 }
-[FlutterTextInputPlugin API_AVAILABLE]
ios(16.0 API_AVAILABLE()

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

2552 {
2553 return _activeView;
2554 }

## Member Data Documentation

## ◆ __pad0__

- __pad0__
| protected

Definition at line 186 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