From 4581399a3c6a0a296dcfcc4f5181dbbe8a8fbb66 Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:37:49 -0700 Subject: [PATCH] Remove unused InlineSpan methods (#135882) --- .../lib/src/painting/placeholder_span.dart | 14 -------------- .../flutter/lib/src/painting/text_span.dart | 19 ------------------- 2 files changed, 33 deletions(-) diff --git a/packages/flutter/lib/src/painting/placeholder_span.dart b/packages/flutter/lib/src/painting/placeholder_span.dart index 628a374102..1235fb92a8 100644 --- a/packages/flutter/lib/src/painting/placeholder_span.dart +++ b/packages/flutter/lib/src/painting/placeholder_span.dart @@ -72,20 +72,6 @@ abstract class PlaceholderSpan extends InlineSpan { collector.add(InlineSpanSemanticsInformation.placeholder); } - /// Populates the `semanticsOffsets` and `semanticsElements` with the appropriate data - /// to be able to construct a [SemanticsNode]. - /// - /// [PlaceholderSpan]s have a text length of 1, which corresponds to the object - /// replacement character (0xFFFC) that is inserted to represent it. - /// - /// Null is added to `semanticsElements` for [PlaceholderSpan]s. - void describeSemantics(Accumulator offset, List semanticsOffsets, List semanticsElements) { - semanticsOffsets.add(offset.value); - semanticsOffsets.add(offset.value + 1); - semanticsElements.add(null); // null indicates this is a placeholder. - offset.increment(1); - } - @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); diff --git a/packages/flutter/lib/src/painting/text_span.dart b/packages/flutter/lib/src/painting/text_span.dart index c3f3731033..634932ee6f 100644 --- a/packages/flutter/lib/src/painting/text_span.dart +++ b/packages/flutter/lib/src/painting/text_span.dart @@ -431,25 +431,6 @@ class TextSpan extends InlineSpan implements HitTestTarget, MouseTrackerAnnotati return localOffset < text.length ? text.codeUnitAt(localOffset) : null; } - /// Populates the `semanticsOffsets` and `semanticsElements` with the appropriate data - /// to be able to construct a [SemanticsNode]. - /// - /// If applicable, the beginning and end text offset are added to [semanticsOffsets]. - /// [PlaceholderSpan]s have a text length of 1, which corresponds to the object - /// replacement character (0xFFFC) that is inserted to represent it. - /// - /// Any [GestureRecognizer]s are added to `semanticsElements`. Null is added to - /// `semanticsElements` for [PlaceholderSpan]s. - void describeSemantics(Accumulator offset, List semanticsOffsets, List semanticsElements) { - if (recognizer is TapGestureRecognizer || recognizer is LongPressGestureRecognizer) { - final int length = semanticsLabel?.length ?? text!.length; - semanticsOffsets.add(offset.value); - semanticsOffsets.add(offset.value + length); - semanticsElements.add(recognizer); - } - offset.increment(text != null ? text!.length : 0); - } - /// In debug mode, throws an exception if the object is not in a valid /// configuration. Otherwise, returns true. ///