| Flutter iOS Embedder |

Instance Methods | List of all members
FlutterSpellCheckPlugin Class Reference

`#import <FlutterSpellCheckPlugin.h>`

Inheritance diagram for FlutterSpellCheckPlugin:

## Instance Methods
(void) | - handleMethodCall:result:

## Detailed Description

Definition at line 11 of file FlutterSpellCheckPlugin.h.

## Method Documentation

## ◆ handleMethodCall:result:

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

Definition at line 32 of file FlutterSpellCheckPlugin.mm.

38 :(FlutterMethodCall*)call result:(FlutterResult)result {
39 if (!self.textChecker) {
40 // UITextChecker is an expensive object to initiate, see:
41 // https://github.com/flutter/flutter/issues/104454. Lazily initialate the UITextChecker object
42 // until at first method channel call. We avoid using lazy getter for testing.
43 self.textChecker = [[UITextChecker alloc] init];
44 }
45 NSString* method = call.method;
46 NSArray* args = call.arguments;
47 if ([method isEqualToString:kInitiateSpellCheck]) {
48 FML_DCHECK(args.count == 2);
49 id language = args[0];
50 id text = args[1];
51 if (language == [NSNull null] || text == [NSNull null]) {
52 // Bail if null arguments are passed from dart.
53 result(nil);
54 return;
55 }
56
57 NSArray<NSDictionary<NSString*, id>*>* spellCheckResult =
58 [self findAllSpellCheckSuggestionsForText:text inLanguage:language];
59 result(spellCheckResult);
60 }
61 }
FlutterResult
void(^ FlutterResult)(id _Nullable result)
Definition: FlutterChannels.h:194
kInitiateSpellCheck
static FLUTTER_ASSERT_ARC NSString *const kInitiateSpellCheck
Definition: FlutterSpellCheckPlugin.mm:15
FlutterMethodCall
Definition: FlutterCodecs.h:221
FlutterMethodCall::method
NSString * method
Definition: FlutterCodecs.h:233
FlutterMethodCall::arguments
id arguments
Definition: FlutterCodecs.h:238

References FlutterMethodCall::arguments, kInitiateSpellCheck, and FlutterMethodCall::method.

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

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