From b9a6ede8ffa6a2228138a65a98680ffe63b8b5fd Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Mon, 24 Jun 2024 11:26:54 -0700 Subject: [PATCH] Fix a number of broken doc comment references (#150540) Work towards https://github.com/flutter/flutter/issues/150562 --- packages/flutter/lib/src/foundation/diagnostics.dart | 3 +++ packages/flutter/lib/src/foundation/isolates.dart | 3 +++ packages/flutter/lib/src/gestures/monodrag.dart | 10 +++++----- packages/flutter/lib/src/gestures/multitap.dart | 6 +++--- packages/flutter/lib/src/gestures/tap.dart | 2 +- packages/flutter/lib/src/material/badge.dart | 2 +- packages/flutter/lib/src/material/button_theme.dart | 4 ++-- packages/flutter/lib/src/material/ink_sparkle.dart | 10 +++++----- packages/flutter/lib/src/material/switch.dart | 2 +- packages/flutter/lib/src/material/text_button.dart | 2 +- packages/flutter/lib/src/material/theme_data.dart | 2 +- packages/flutter/lib/src/painting/image_stream.dart | 8 ++++---- packages/flutter/lib/src/services/undo_manager.dart | 2 +- packages/flutter/lib/src/widgets/basic.dart | 8 ++++---- .../lib/src/widgets/context_menu_controller.dart | 2 +- packages/flutter/lib/src/widgets/transitions.dart | 2 +- 16 files changed, 37 insertions(+), 31 deletions(-) diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart index 3dc43e38b1..08b775e81e 100644 --- a/packages/flutter/lib/src/foundation/diagnostics.dart +++ b/packages/flutter/lib/src/foundation/diagnostics.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'dart:developer'; +library; + import 'dart:math' as math; import 'dart:ui' show clampDouble; diff --git a/packages/flutter/lib/src/foundation/isolates.dart b/packages/flutter/lib/src/foundation/isolates.dart index 9c0bae37bc..8a4cc266a3 100644 --- a/packages/flutter/lib/src/foundation/isolates.dart +++ b/packages/flutter/lib/src/foundation/isolates.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'dart:isolate'; +library; + import 'dart:async'; import '_isolates_io.dart' diff --git a/packages/flutter/lib/src/gestures/monodrag.dart b/packages/flutter/lib/src/gestures/monodrag.dart index 9de2c78fe9..1913cd7f8a 100644 --- a/packages/flutter/lib/src/gestures/monodrag.dart +++ b/packages/flutter/lib/src/gestures/monodrag.dart @@ -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 diff --git a/packages/flutter/lib/src/gestures/multitap.dart b/packages/flutter/lib/src/gestures/multitap.dart index 2c9b6f5c31..46be06bd7a 100644 --- a/packages/flutter/lib/src/gestures/multitap.dart +++ b/packages/flutter/lib/src/gestures/multitap.dart @@ -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; diff --git a/packages/flutter/lib/src/gestures/tap.dart b/packages/flutter/lib/src/gestures/tap.dart index d522c79911..0bdc01e341 100644 --- a/packages/flutter/lib/src/gestures/tap.dart +++ b/packages/flutter/lib/src/gestures/tap.dart @@ -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 diff --git a/packages/flutter/lib/src/material/badge.dart b/packages/flutter/lib/src/material/badge.dart index 2f93d61e6b..8a04ac94af 100644 --- a/packages/flutter/lib/src/material/badge.dart +++ b/packages/flutter/lib/src/material/badge.dart @@ -74,7 +74,7 @@ class Badge extends StatelessWidget { /// The badge's fill color. /// /// Defaults to the [BadgeTheme]'s background color, or - /// [ColorScheme.errorColor] if the theme value is null. + /// [ColorScheme.error] if the theme value is null. final Color? backgroundColor; /// The color of the badge's [label] text. diff --git a/packages/flutter/lib/src/material/button_theme.dart b/packages/flutter/lib/src/material/button_theme.dart index f0e3afc98d..4fcf9b7fbc 100644 --- a/packages/flutter/lib/src/material/button_theme.dart +++ b/packages/flutter/lib/src/material/button_theme.dart @@ -238,7 +238,7 @@ class ButtonThemeData with Diagnosticable { /// /// See also: /// - /// * [getPadding], which is used to calculate padding for the [button]'s + /// * [getPadding], which is used to calculate padding for the button's /// child (typically the button's label). EdgeInsetsGeometry get padding { return _padding ?? switch (textTheme) { @@ -261,7 +261,7 @@ class ButtonThemeData with Diagnosticable { /// /// See also: /// - /// * [getShape], which is used to calculate the shape of the [button]'s + /// * [getShape], which is used to calculate the shape of the button's /// [Material]. ShapeBorder get shape { return _shape ?? switch (textTheme) { diff --git a/packages/flutter/lib/src/material/ink_sparkle.dart b/packages/flutter/lib/src/material/ink_sparkle.dart index 540e8b5247..2bd336e314 100644 --- a/packages/flutter/lib/src/material/ink_sparkle.dart +++ b/packages/flutter/lib/src/material/ink_sparkle.dart @@ -27,12 +27,12 @@ import 'material.dart'; /// The [controller] argument is typically obtained via /// `Material.of(context)`. /// -/// If [containedInkWell] is true, then the effect will be sized to fit +/// If `containedInkWell` is true, then the effect will be sized to fit /// the well rectangle, and clipped to it when drawn. The well -/// rectangle is the box returned by [rectCallback], if provided, or +/// rectangle is the box returned by `rectCallback`, if provided, or /// otherwise is the bounds of the [referenceBox]. /// -/// If [containedInkWell] is false, then [rectCallback] should be null. +/// If `containedInkWell` is false, then `rectCallback` should be null. /// The ink ripple is clipped only to the edges of the [Material]. /// This is the default. /// @@ -249,14 +249,14 @@ class InkSparkle extends InteractiveInkFeature { /// Used to specify this type of ink splash for an [InkWell], [InkResponse], /// material [Theme], or [ButtonStyle]. /// - /// Since no [turbulenceSeed] is passed, the effect will be random for + /// Since no `turbulenceSeed` is passed, the effect will be random for /// subsequent presses in the same position. static const InteractiveInkFeatureFactory splashFactory = _InkSparkleFactory(); /// Used to specify this type of ink splash for an [InkWell], [InkResponse], /// material [Theme], or [ButtonStyle]. /// - /// Since a [turbulenceSeed] is passed, the effect will not be random for + /// Since a `turbulenceSeed` is passed, the effect will not be random for /// subsequent presses in the same position. This can be used for testing. static const InteractiveInkFeatureFactory constantTurbulenceSeedSplashFactory = _InkSparkleFactory.constantTurbulenceSeed(); diff --git a/packages/flutter/lib/src/material/switch.dart b/packages/flutter/lib/src/material/switch.dart index 2c9e411f76..aab4348d3e 100644 --- a/packages/flutter/lib/src/material/switch.dart +++ b/packages/flutter/lib/src/material/switch.dart @@ -138,7 +138,7 @@ class Switch extends StatelessWidget { /// /// To provide a custom switch theme that's only used by this factory /// constructor, add a custom `Adaptation` class to - /// [ThemeData.adaptations]. This can be useful in situations where you don't + /// `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. /// diff --git a/packages/flutter/lib/src/material/text_button.dart b/packages/flutter/lib/src/material/text_button.dart index 078b44d512..9b60c70ad4 100644 --- a/packages/flutter/lib/src/material/text_button.dart +++ b/packages/flutter/lib/src/material/text_button.dart @@ -376,7 +376,7 @@ class TextButton extends ButtonStyleButton { /// * `splashFactory` - Theme.splashFactory /// /// For the [TextButton.icon] factory, the end (generally the right) value of - /// [padding] is increased from 12 to 16. + /// `padding` is increased from 12 to 16. /// {@endtemplate} @override ButtonStyle defaultStyleOf(BuildContext context) { diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 6910859514..9ebea08c0b 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -87,7 +87,7 @@ class Adaptation { /// 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 + /// [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] diff --git a/packages/flutter/lib/src/painting/image_stream.dart b/packages/flutter/lib/src/painting/image_stream.dart index ab3d1db828..63a24e4a0b 100644 --- a/packages/flutter/lib/src/painting/image_stream.dart +++ b/packages/flutter/lib/src/painting/image_stream.dart @@ -59,7 +59,7 @@ class ImageInfo { /// /// See also: /// - /// * [Image.clone], which describes how and why to clone images. + /// * [ui.Image.clone], which describes how and why to clone images. ImageInfo clone() { return ImageInfo( image: image.clone(), @@ -70,9 +70,9 @@ class ImageInfo { /// Whether this [ImageInfo] is a [clone] of the `other`. /// - /// This method is a convenience wrapper for [Image.isCloneOf], and is useful - /// for clients that are trying to determine whether new layout or painting - /// logic is required when receiving a new image reference. + /// This method is a convenience wrapper for [ui.Image.isCloneOf], and is + /// useful for clients that are trying to determine whether new layout or + /// painting logic is required when receiving a new image reference. /// /// {@tool snippet} /// diff --git a/packages/flutter/lib/src/services/undo_manager.dart b/packages/flutter/lib/src/services/undo_manager.dart index 7ba3303540..f65f1c68f5 100644 --- a/packages/flutter/lib/src/services/undo_manager.dart +++ b/packages/flutter/lib/src/services/undo_manager.dart @@ -21,7 +21,7 @@ enum UndoDirection { /// [UndoManagerClient] and set it as the [client] on [UndoManager]. /// /// The [setUndoState] method can be used to update the system's undo manager -/// using the [canUndo] and [canRedo] parameters. +/// using the `canUndo` and `canRedo` parameters. /// /// When the system undo or redo button is tapped, the current /// [UndoManagerClient] will receive [UndoManagerClient.handlePlatformUndo] diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 47ce250e67..766ce54e05 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -5934,8 +5934,8 @@ class RichText extends MultiChildRenderObjectWidget { /// various fields on this class in more detail. /// /// The [image] is not disposed of by this widget. Creators of the widget are -/// expected to call [Image.dispose] on the [image] once the [RawImage] is no -/// longer buildable. +/// expected to call [dart:ui.Image.dispose] on the [image] once the [RawImage] +/// is no longer buildable. /// /// This widget is rarely used directly. Instead, consider using [Image]. class RawImage extends LeafRenderObjectWidget { @@ -5966,8 +5966,8 @@ class RawImage extends LeafRenderObjectWidget { /// The image to display. /// /// Since a [RawImage] is stateless, it does not ever dispose this image. - /// Creators of a [RawImage] are expected to call [Image.dispose] on this - /// image handle when the [RawImage] will no longer be needed. + /// Creators of a [RawImage] are expected to call [dart:ui.Image.dispose] on + /// this image handle when the [RawImage] will no longer be needed. final ui.Image? image; /// A string identifying the source of the image. diff --git a/packages/flutter/lib/src/widgets/context_menu_controller.dart b/packages/flutter/lib/src/widgets/context_menu_controller.dart index 6e29a2b0ad..566a7e96ca 100644 --- a/packages/flutter/lib/src/widgets/context_menu_controller.dart +++ b/packages/flutter/lib/src/widgets/context_menu_controller.dart @@ -95,7 +95,7 @@ class ContextMenuController { /// Cause the underlying [OverlayEntry] to rebuild during the next pipeline /// flush. /// - /// It's necessary to call this function if the output of [contextMenuBuilder] + /// It's necessary to call this function if the output of `contextMenuBuilder` /// has changed. /// /// Errors if the context menu is not currently shown. diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index 6a5e881a9a..a19fee9c27 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -621,7 +621,7 @@ class FadeTransition extends SingleChildRenderObjectWidget { /// To avoid such problems, it is generally a good idea to combine this widget /// with a [SliverIgnorePointer] that one enables when the [opacity] animation /// reaches zero. This prevents interactions with any children in the subtree -/// when the [sliver] is not visible. For performance reasons, when implementing +/// when the sliver is not visible. For performance reasons, when implementing /// this, care should be taken not to rebuild the relevant widget (e.g. by /// calling [State.setState]) except at the transition point. ///