/// Paints the text onto the given canvas at the given offset.
...
...
@@ -612,7 +610,7 @@ class TextPainter {
}
returntrue;
}());
canvas.drawParagraph(_paragraph,offset);
canvas.drawParagraph(_paragraph!,offset);
}
// Returns true iff the given value is a valid UTF-16 surrogate. The value
...
...
@@ -634,8 +632,8 @@ class TextPainter {
/// Returns the closest offset after `offset` at which the input cursor can be
/// positioned.
intgetOffsetAfter(intoffset){
finalintnextCodeUnit=_text.codeUnitAt(offset);
int?getOffsetAfter(intoffset){
finalint?nextCodeUnit=_text!.codeUnitAt(offset);
if(nextCodeUnit==null)
returnnull;
// TODO(goderbauer): doesn't handle extended grapheme clusters with more than one Unicode scalar value (https://github.com/flutter/flutter/issues/13404).
...
...
@@ -644,8 +642,8 @@ class TextPainter {
/// Returns the closest offset before `offset` at which the input cursor can
// TODO(goderbauer): doesn't handle extended grapheme clusters with more than one Unicode scalar value (https://github.com/flutter/flutter/issues/13404).
...
...
@@ -657,21 +655,21 @@ class TextPainter {
// Get the Rect of the cursor (in logical pixels) based off the near edge
// of the character upstream from the given string offset.