Flutter Engine
 
Loading...
Searching...
No Matches
FlutterSpellCheckPlugin Class Reference

#include <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}
void(^ FlutterResult)(id _Nullable result)
static FLUTTER_ASSERT_ARC NSString *const kInitiateSpellCheck
if(end==-1)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define FML_DCHECK(condition)
Definition logging.h:122
std::u16string text

References args, FlutterMethodCall::arguments, FML_DCHECK, kInitiateSpellCheck, FlutterMethodCall::method, self, and text.


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