File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/data_detector/lib Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,20 @@ class TextCheckingResult {
26
26
binding.NSTextCheckingType get type => _inner.resultType;
27
27
28
28
TextRange get range {
29
- final p = malloc.allocate< binding.NSRange > (sizeOf< binding.NSRange > ());
30
- _inner.getRange (p);
29
+ final msgSend = objc.msgSendPointer
30
+ .cast<
31
+ NativeFunction <
32
+ binding.NSRange Function (
33
+ Pointer <objc.ObjCObject >, Pointer <objc.ObjCSelector >)>> ()
34
+ .asFunction<
35
+ binding.NSRange Function (
36
+ Pointer <objc.ObjCObject >, Pointer <objc.ObjCSelector >)> ();
37
+ final property = objc.registerName ("range" );
38
+
39
+ // the generated _inner.getRange() not working on macos x64, call send manually
40
+ final range = msgSend (_inner.pointer, property);
31
41
final textRange =
32
- TextRange (start: p.ref.location, end: p.ref.location + p.ref.length);
33
- malloc.free (p);
42
+ TextRange (start: range.location, end: range.location + range.length);
34
43
return textRange;
35
44
}
36
45
You can’t perform that action at this time.
0 commit comments