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