@@ -366,7 +355,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
if(_obscuringCharacter==value){
return;
}
assert(value!=null&&value.length==1);
assert(value!=null&&value.characters.length==1);
_obscuringCharacter=value;
markNeedsLayout();
}
...
...
@@ -518,10 +507,6 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
..._nonModifierKeys,
};
// TODO(goderbauer): doesn't handle extended grapheme clusters with more than one Unicode scalar value (https://github.com/flutter/flutter/issues/13404).
// This is because some of this code depends upon counting the length of the
// string using Unicode scalar values, rather than using the number of
// extended grapheme clusters (a.k.a. "characters" in the end user's mind).
void_handleKeyEvent(RawKeyEventkeyEvent){
if(kIsWeb){
// On web platform, we should ignore the key because it's processed already.
...
...
@@ -557,6 +542,71 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
}
}
/// Returns the index into the string of the next character boundary after the
/// given index.
///
/// The character boundary is determined by the characters package, so
/// surrogate pairs and extended grapheme clusters are considered.
///
/// The index must be between 0 and string.length, inclusive. If given
/// string.length, string.length is returned.
///
/// Setting includeWhitespace to false will only return the index of non-space