From 9e7cc970eafc9eca78bb46d3fb745630f84414d3 Mon Sep 17 00:00:00 2001 From: Tomasz Gucio <72562119+tgucio@users.noreply.github.com> Date: Wed, 23 Feb 2022 23:59:06 +0100 Subject: [PATCH] Use int for PlaceholderSpan.placeholderCodeUnit (#98971) --- packages/flutter/lib/src/painting/placeholder_span.dart | 4 ++-- packages/flutter/lib/src/widgets/widget_span.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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