mirror of
https://github.com/flutter/flutter
synced 2024-10-05 15:59:49 +00:00
Linkify 'see also' sections (#150734)
Follow-up to https://github.com/flutter/flutter/pull/150540. Fixes https://github.com/flutter/flutter/issues/150562.
This commit is contained in:
parent
9efe11c6cb
commit
d2b42d8c13
|
@ -81,8 +81,8 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
|
|||
this.velocityTrackerBuilder = _defaultBuilder,
|
||||
this.onlyAcceptDragOnThreshold = false,
|
||||
super.supportedDevices,
|
||||
AllowedButtonsFilter? allowedButtonsFilter,
|
||||
}) : super(allowedButtonsFilter: allowedButtonsFilter ?? _defaultButtonAcceptBehavior);
|
||||
super.allowedButtonsFilter = _defaultButtonAcceptBehavior,
|
||||
});
|
||||
|
||||
static VelocityTracker _defaultBuilder(PointerEvent event) => VelocityTracker.withKind(event.kind);
|
||||
|
||||
|
@ -146,7 +146,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
|
|||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * `allowedButtonsFilter`, which decides which button will be allowed.
|
||||
/// * [allowedButtonsFilter], which decides which button will be allowed.
|
||||
/// * [DragDownDetails], which is passed as an argument to this callback.
|
||||
GestureDragDownCallback? onDown;
|
||||
|
||||
|
@ -161,7 +161,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
|
|||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * `allowedButtonsFilter`, which decides which button will be allowed.
|
||||
/// * [allowedButtonsFilter], which decides which button will be allowed.
|
||||
/// * [DragStartDetails], which is passed as an argument to this callback.
|
||||
GestureDragStartCallback? onStart;
|
||||
|
||||
|
@ -183,7 +183,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
|
|||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * `allowedButtonsFilter`, which decides which button will be allowed.
|
||||
/// * [allowedButtonsFilter], which decides which button will be allowed.
|
||||
/// * [DragUpdateDetails], which is passed as an argument to this callback.
|
||||
GestureDragUpdateCallback? onUpdate;
|
||||
|
||||
|
@ -206,7 +206,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
|
|||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * `allowedButtonsFilter`, which decides which button will be allowed.
|
||||
/// * [allowedButtonsFilter], which decides which button will be allowed.
|
||||
/// * [DragEndDetails], which is passed as an argument to this callback.
|
||||
GestureDragEndCallback? onEnd;
|
||||
|
||||
|
@ -214,7 +214,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
|
|||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * `allowedButtonsFilter`, which decides which button will be allowed.
|
||||
/// * [allowedButtonsFilter], which decides which button will be allowed.
|
||||
GestureDragCancelCallback? onCancel;
|
||||
|
||||
/// The minimum distance an input pointer drag must have moved
|
||||
|
|
|
@ -119,8 +119,8 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
|
|||
DoubleTapGestureRecognizer({
|
||||
super.debugOwner,
|
||||
super.supportedDevices,
|
||||
AllowedButtonsFilter? allowedButtonsFilter,
|
||||
}) : super(allowedButtonsFilter: allowedButtonsFilter ?? _defaultButtonAcceptBehavior);
|
||||
super.allowedButtonsFilter = _defaultButtonAcceptBehavior,
|
||||
});
|
||||
|
||||
// The default value for [allowedButtonsFilter].
|
||||
// Accept the input if, and only if, [kPrimaryButton] is pressed.
|
||||
|
@ -161,7 +161,7 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
|
|||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * `allowedButtonsFilter`, which decides which button will be allowed.
|
||||
/// * [allowedButtonsFilter], which decides which button will be allowed.
|
||||
/// * [TapDownDetails], which is passed as an argument to this callback.
|
||||
/// * [GestureDetector.onDoubleTapDown], which exposes this callback.
|
||||
GestureTapDownCallback? onDoubleTapDown;
|
||||
|
@ -174,7 +174,7 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
|
|||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * `allowedButtonsFilter`, which decides which button will be allowed.
|
||||
/// * [allowedButtonsFilter], which decides which button will be allowed.
|
||||
/// * [GestureDetector.onDoubleTap], which exposes this callback.
|
||||
GestureDoubleTapCallback? onDoubleTap;
|
||||
|
||||
|
@ -188,7 +188,7 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
|
|||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * `allowedButtonsFilter`, which decides which button will be allowed.
|
||||
/// * [allowedButtonsFilter], which decides which button will be allowed.
|
||||
/// * [GestureDetector.onDoubleTapCancel], which exposes this callback.
|
||||
GestureTapCancelCallback? onDoubleTapCancel;
|
||||
|
||||
|
|
|
@ -101,7 +101,8 @@ enum MultitouchDragStrategy {
|
|||
sumAllPointers,
|
||||
}
|
||||
|
||||
/// Signature for `allowedButtonsFilter` in [GestureRecognizer].
|
||||
/// Signature for [GestureRecognizer.allowedButtonsFilter].
|
||||
///
|
||||
/// Used to filter the input buttons of incoming pointer events.
|
||||
/// The parameter `buttons` comes from [PointerEvent.buttons].
|
||||
typedef AllowedButtonsFilter = bool Function(int buttons);
|
||||
|
@ -132,8 +133,8 @@ abstract class GestureRecognizer extends GestureArenaMember with DiagnosticableT
|
|||
GestureRecognizer({
|
||||
this.debugOwner,
|
||||
this.supportedDevices,
|
||||
AllowedButtonsFilter? allowedButtonsFilter,
|
||||
}) : _allowedButtonsFilter = allowedButtonsFilter ?? _defaultButtonAcceptBehavior {
|
||||
this.allowedButtonsFilter = _defaultButtonAcceptBehavior,
|
||||
}) {
|
||||
// TODO(polina-c): stop duplicating code across disposables
|
||||
// https://github.com/flutter/flutter/issues/137435
|
||||
if (kFlutterMemoryAllocationsEnabled) {
|
||||
|
@ -178,7 +179,7 @@ abstract class GestureRecognizer extends GestureArenaMember with DiagnosticableT
|
|||
///
|
||||
/// Defaults to all buttons.
|
||||
/// {@endtemplate}
|
||||
final AllowedButtonsFilter _allowedButtonsFilter;
|
||||
final AllowedButtonsFilter allowedButtonsFilter;
|
||||
|
||||
// The default value for [allowedButtonsFilter].
|
||||
// Accept any input.
|
||||
|
@ -271,9 +272,8 @@ abstract class GestureRecognizer extends GestureArenaMember with DiagnosticableT
|
|||
/// Checks whether or not a pointer is allowed to be tracked by this recognizer.
|
||||
@protected
|
||||
bool isPointerAllowed(PointerDownEvent event) {
|
||||
return (supportedDevices == null ||
|
||||
supportedDevices!.contains(event.kind)) &&
|
||||
_allowedButtonsFilter(event.buttons);
|
||||
return (supportedDevices == null || supportedDevices!.contains(event.kind))
|
||||
&& allowedButtonsFilter(event.buttons);
|
||||
}
|
||||
|
||||
/// Handles a pointer pan/zoom being added that's not allowed by this recognizer.
|
||||
|
|
|
@ -354,7 +354,7 @@ abstract class BaseTapGestureRecognizer extends PrimaryPointerGestureRecognizer
|
|||
/// no-op.
|
||||
///
|
||||
/// {@template flutter.gestures.tap.TapGestureRecognizer.allowedButtonsFilter}
|
||||
/// The `allowedButtonsFilter` argument only gives this recognizer the
|
||||
/// The [allowedButtonsFilter] argument only gives this recognizer the
|
||||
/// ability to limit the buttons it accepts. It does not provide the
|
||||
/// ability to recognize any buttons beyond the ones it already accepts:
|
||||
/// kPrimaryButton, kSecondaryButton or kTertiaryButton. Therefore, a
|
||||
|
|
|
@ -137,10 +137,10 @@ class Switch extends StatelessWidget {
|
|||
/// is iOS or macOS, otherwise a Material Design switch is created.
|
||||
///
|
||||
/// To provide a custom switch theme that's only used by this factory
|
||||
/// constructor, add a custom `Adaptation<SwitchThemeData>` class to
|
||||
/// `ThemeData.adaptations`. This can be useful in situations where you don't
|
||||
/// want the overall [ThemeData.switchTheme] to apply when this adaptive
|
||||
/// constructor is used.
|
||||
/// constructor, pass a custom `Adaptation<SwitchThemeData>` class to the
|
||||
/// `adaptations` parameter of [ThemeData]. This can be useful in situations
|
||||
/// where you don't want the overall [ThemeData.switchTheme] to apply when
|
||||
/// this adaptive constructor is used.
|
||||
///
|
||||
/// {@tool dartpad}
|
||||
/// This sample shows how to create and use subclasses of [Adaptation] that
|
||||
|
|
|
@ -87,11 +87,12 @@ class Adaptation<T> {
|
|||
/// ThemeData class, like [SwitchThemeData], instead of the defaultValue.
|
||||
///
|
||||
/// Factory constructors that support adaptations - currently only
|
||||
/// [Switch.adaptive] - look for a `ThemeData.adaptations` member of the expected
|
||||
/// type when computing their effective default component theme. If a matching
|
||||
/// adaptation is not found, the component may choose to use a default adaptation.
|
||||
/// For example, the [Switch.adaptive] component uses an empty [SwitchThemeData]
|
||||
/// if a matching adaptation is not found, for the sake of backwards compatibility.
|
||||
/// [Switch.adaptive] - look for a type-specific adaptation in
|
||||
/// [ThemeData.adaptationMap] when computing their effective default component
|
||||
/// theme. If a matching adaptation is not found, the component may choose to
|
||||
/// use a default adaptation. For example, the [Switch.adaptive] component
|
||||
/// uses an empty [SwitchThemeData] if a matching adaptation is not found, for
|
||||
/// the sake of backwards compatibility.
|
||||
///
|
||||
/// {@tool dartpad}
|
||||
/// This sample shows how to create and use subclasses of [Adaptation] that
|
||||
|
|
Loading…
Reference in a new issue