diff --git a/packages/flutter/lib/src/painting/placeholder_span.dart b/packages/flutter/lib/src/painting/placeholder_span.dart index 1f0c0cbbbf..536b52e950 100644 --- a/packages/flutter/lib/src/painting/placeholder_span.dart +++ b/packages/flutter/lib/src/painting/placeholder_span.dart @@ -42,7 +42,7 @@ abstract class PlaceholderSpan extends InlineSpan { }) : super(style: style); /// The unicode character to represent a placeholder. - static const String placeholderCodeUnit = '\uFFFC'; + static const int placeholderCodeUnit = 0xFFFC; /// How the placeholder aligns vertically with the text. /// @@ -60,7 +60,7 @@ abstract class PlaceholderSpan extends InlineSpan { @override void computeToPlainText(StringBuffer buffer, {bool includeSemanticsLabels = true, bool includePlaceholders = true}) { if (includePlaceholders) { - buffer.write(placeholderCodeUnit); + buffer.writeCharCode(placeholderCodeUnit); } } diff --git a/packages/flutter/lib/src/widgets/widget_span.dart b/packages/flutter/lib/src/widgets/widget_span.dart index 686bf7779c..b4c035682d 100644 --- a/packages/flutter/lib/src/widgets/widget_span.dart +++ b/packages/flutter/lib/src/widgets/widget_span.dart @@ -140,7 +140,7 @@ class WidgetSpan extends PlaceholderSpan { @override int? codeUnitAtVisitor(int index, Accumulator offset) { offset.increment(1); - return PlaceholderSpan.placeholderCodeUnit.codeUnitAt(0); + return PlaceholderSpan.placeholderCodeUnit; } @override