From 938e4eb63676b0598d609fde660237f42a6ab7c0 Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Fri, 7 Jun 2019 18:14:54 -0700 Subject: [PATCH] Add recognizer compatibility API (#34086) --- packages/flutter/lib/src/painting/inline_span.dart | 6 ++++++ packages/flutter/lib/src/painting/text_span.dart | 1 + 2 files changed, 7 insertions(+) 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].