Flutter iOS Embedder
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< FlutterIndirectScribbleDelegateindirectScribbleDelegate
 
NSMutableDictionary< UIScribbleElementIdentifier, NSValue * > * scribbleElements
 

Detailed Description

Definition at line 29 of file FlutterTextInputPlugin.h.

Method Documentation

◆ handleMethodCall:result:

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

Definition at line 2327 of file FlutterTextInputPlugin.mm.

2327  :(FlutterMethodCall*)call result:(FlutterResult)result {
2328  NSString* method = call.method;
2329  id args = call.arguments;
2330  if ([method isEqualToString:kShowMethod]) {
2331  [self showTextInput];
2332  result(nil);
2333  } else if ([method isEqualToString:kHideMethod]) {
2334  [self hideTextInput];
2335  result(nil);
2336  } else if ([method isEqualToString:kSetClientMethod]) {
2337  [self setTextInputClient:[args[0] intValue] withConfiguration:args[1]];
2338  result(nil);
2339  } else if ([method isEqualToString:kSetPlatformViewClientMethod]) {
2340  // This method call has a `platformViewId` argument, but we do not need it for iOS for now.
2341  [self setPlatformViewTextInputClient];
2342  result(nil);
2343  } else if ([method isEqualToString:kSetEditingStateMethod]) {
2344  [self setTextInputEditingState:args];
2345  result(nil);
2346  } else if ([method isEqualToString:kClearClientMethod]) {
2347  [self clearTextInputClient];
2348  result(nil);
2349  } else if ([method isEqualToString:kSetEditableSizeAndTransformMethod]) {
2350  [self setEditableSizeAndTransform:args];
2351  result(nil);
2352  } else if ([method isEqualToString:kSetMarkedTextRectMethod]) {
2353  [self updateMarkedRect:args];
2354  result(nil);
2355  } else if ([method isEqualToString:kFinishAutofillContextMethod]) {
2356  [self triggerAutofillSave:[args boolValue]];
2357  result(nil);
2358  // TODO(justinmc): Remove the TextInput method constant when the framework has
2359  // finished transitioning to using the Scribble channel.
2360  // https://github.com/flutter/flutter/pull/104128
2361  } else if ([method isEqualToString:kDeprecatedSetSelectionRectsMethod]) {
2362  [self setSelectionRects:args];
2363  result(nil);
2364  } else if ([method isEqualToString:kSetSelectionRectsMethod]) {
2365  [self setSelectionRects:args];
2366  result(nil);
2367  } else if ([method isEqualToString:kStartLiveTextInputMethod]) {
2368  [self startLiveTextInput];
2369  result(nil);
2370  } else if ([method isEqualToString:kUpdateConfigMethod]) {
2371  [self updateConfig:args];
2372  result(nil);
2373  } else if ([method isEqualToString:kOnInteractiveKeyboardPointerMoveMethod]) {
2374  CGFloat pointerY = (CGFloat)[args[@"pointerY"] doubleValue];
2375  [self handlePointerMove:pointerY];
2376  result(nil);
2377  } else if ([method isEqualToString:kOnInteractiveKeyboardPointerUpMethod]) {
2378  CGFloat pointerY = (CGFloat)[args[@"pointerY"] doubleValue];
2379  [self handlePointerUp:pointerY];
2380  result(nil);
2381  } else {
2383  }
2384 }

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

2287  :(id<FlutterTextInputDelegate>)textInputDelegate {
2288  self = [super init];
2289  if (self) {
2290  // `_textInputDelegate` is a weak reference because it should retain FlutterTextInputPlugin.
2291  _textInputDelegate = textInputDelegate;
2292  _autofillContext = [[NSMutableDictionary alloc] init];
2293  _inputHider = [[FlutterTextInputViewAccessibilityHider alloc] init];
2294  _scribbleElements = [[NSMutableDictionary alloc] init];
2295  _keyboardViewContainer = [[UIView alloc] init];
2296 
2297  [[NSNotificationCenter defaultCenter] addObserver:self
2298  selector:@selector(handleKeyboardWillShow:)
2299  name:UIKeyboardWillShowNotification
2300  object:nil];
2301  }
2302 
2303  return self;
2304 }

◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE

◆ resetViewResponder

- (void) resetViewResponder

Definition at line 2957 of file FlutterTextInputPlugin.mm.

2957  {
2958  _viewResponder = nil;
2959 }

◆ setUpIndirectScribbleInteraction:

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

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

Definition at line 2943 of file FlutterTextInputPlugin.mm.

2943  :(id<FlutterViewResponder>)viewResponder {
2944  if (_viewResponder != viewResponder) {
2945  if (@available(iOS 14.0, *)) {
2946  UIView* parentView = viewResponder.view;
2947  if (parentView != nil) {
2948  UIIndirectScribbleInteraction* scribbleInteraction = [[UIIndirectScribbleInteraction alloc]
2949  initWithDelegate:(id<UIIndirectScribbleInteractionDelegate>)self];
2950  [parentView addInteraction:scribbleInteraction];
2951  }
2952  }
2953  }
2954  _viewResponder = viewResponder;
2955 }

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

2323  {
2324  return _activeView;
2325 }

Member Data Documentation

◆ __pad0__

- __pad0__
protected

Definition at line 30 of file FlutterTextInputPlugin.h.

Property Documentation

◆ indirectScribbleDelegate

- (id<FlutterIndirectScribbleDelegate>) indirectScribbleDelegate
readwritenonatomicweak

Definition at line 33 of file FlutterTextInputPlugin.h.

◆ scribbleElements

- (NSMutableDictionary<UIScribbleElementIdentifier, NSValue*>*) scribbleElements
readwritenonatomicstrong

Definition at line 35 of file FlutterTextInputPlugin.h.

◆ viewController

- (UIIndirectScribbleInteractionDelegate UIViewController*) viewController
readwritenonatomicweak

Definition at line 32 of file FlutterTextInputPlugin.h.


The documentation for this class was generated from the following files:
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:196
kOnInteractiveKeyboardPointerMoveMethod
static NSString *const kOnInteractiveKeyboardPointerMoveMethod
Definition: FlutterTextInputPlugin.mm:56
FlutterTextInputViewAccessibilityHider
Definition: FlutterTextInputPlugin.mm:2229
viewResponder
id< FlutterViewResponder > viewResponder
Definition: FlutterTextInputPlugin.h:155
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