mirror of
https://github.com/flutter/flutter
synced 2024-10-13 03:32:55 +00:00
Convert to TextPosition for getWordBoundary (#44611)
Convert the call to getWordBoundary to use a TextPosition, in preparation for landing flutter/engine#13727, which switches the desired API to the final desired API.
This commit is contained in:
parent
86c91b12d8
commit
23d1ae0ff7
|
@ -818,7 +818,7 @@ class TextPainter {
|
|||
assert(!_needsLayout);
|
||||
// TODO(gspencergoog): remove the List<int>-based code when the engine API
|
||||
// returns a TextRange instead of a List<int>.
|
||||
final dynamic boundary = _paragraph.getWordBoundary(position.offset);
|
||||
final dynamic boundary = _paragraph.getWordBoundary(position);
|
||||
if (boundary is List<int>) {
|
||||
final List<int> indices = boundary;
|
||||
return TextRange(start: indices[0], end: indices[1]);
|
||||
|
|
Loading…
Reference in a new issue