Add recognizer compatibility API (#34086)

This commit is contained in:
Gary Qian 2019-06-07 18:14:54 -07:00 committed by GitHub
parent 6180a150c9
commit 938e4eb636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -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<InlineSpan> 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.
///

View File

@ -170,6 +170,7 @@ class TextSpan extends InlineSpan {
/// }
/// ```
/// {@end-tool}
@override
final GestureRecognizer recognizer;
/// An alternative semantics label for this [TextSpan].