diff --git a/packages/flutter/lib/src/painting/inline_span.dart b/packages/flutter/lib/src/painting/inline_span.dart index 400f7f4768..e1e13cf6f1 100644 --- a/packages/flutter/lib/src/painting/inline_span.dart +++ b/packages/flutter/lib/src/painting/inline_span.dart @@ -5,6 +5,7 @@ import 'dart:ui' as ui show ParagraphBuilder; import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; import 'basic_types.dart'; import 'text_painter.dart'; @@ -102,6 +103,11 @@ abstract class InlineSpan extends DiagnosticableTree { @Deprecated('InlineSpan does not innately have children. Use TextSpan.children instead.') List get children => null; + /// Returns the [GestureRecognizer] associated with this span if this is an + /// instance of [TextSpan], otherwise returns null. + @Deprecated('InlineSpan does not innately have a recognizer. Use TextSpan.recognizer instead.') + GestureRecognizer get recognizer => null; + /// Apply the properties of this object to the given [ParagraphBuilder], from /// which a [Paragraph] can be obtained. /// diff --git a/packages/flutter/lib/src/painting/text_span.dart b/packages/flutter/lib/src/painting/text_span.dart index e0eef8fd42..f8d80a64c4 100644 --- a/packages/flutter/lib/src/painting/text_span.dart +++ b/packages/flutter/lib/src/painting/text_span.dart @@ -170,6 +170,7 @@ class TextSpan extends InlineSpan { /// } /// ``` /// {@end-tool} + @override final GestureRecognizer recognizer; /// An alternative semantics label for this [TextSpan].