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

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

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

2301  :(id<FlutterTextInputDelegate>)textInputDelegate {
2302  self = [super init];
2303  if (self) {
2304  // `_textInputDelegate` is a weak reference because it should retain FlutterTextInputPlugin.
2305  _textInputDelegate = textInputDelegate;
2306  _autofillContext = [[NSMutableDictionary alloc] init];
2307  _inputHider = [[FlutterTextInputViewAccessibilityHider alloc] init];
2308  _scribbleElements = [[NSMutableDictionary alloc] init];
2309  _keyboardViewContainer = [[UIView alloc] init];
2310 
2311  [[NSNotificationCenter defaultCenter] addObserver:self
2312  selector:@selector(handleKeyboardWillShow:)
2313  name:UIKeyboardWillShowNotification
2314  object:nil];
2315  }
2316 
2317  return self;
2318 }

◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE

◆ resetViewResponder

- (void) resetViewResponder

Definition at line 2971 of file FlutterTextInputPlugin.mm.

2971  {
2972  _viewResponder = nil;
2973 }

◆ setUpIndirectScribbleInteraction:

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

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

Definition at line 2957 of file FlutterTextInputPlugin.mm.

2957  :(id<FlutterViewResponder>)viewResponder {
2958  if (_viewResponder != viewResponder) {
2959  if (@available(iOS 14.0, *)) {
2960  UIView* parentView = viewResponder.view;
2961  if (parentView != nil) {
2962  UIIndirectScribbleInteraction* scribbleInteraction = [[UIIndirectScribbleInteraction alloc]
2963  initWithDelegate:(id<UIIndirectScribbleInteractionDelegate>)self];
2964  [parentView addInteraction:scribbleInteraction];
2965  }
2966  }
2967  }
2968  _viewResponder = viewResponder;
2969 }

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

2337  {
2338  return _activeView;
2339 }

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:2243
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