Skip to content

Commit 734b4de

Browse files
authored
Fix unresolved doc comment references in Material and Cupertino (flutter#193283)
Follow-up to flutter#192734, flutter#193087 and flutter#193216, covering the references inside `lib/src/material` and `lib/src/cupertino`. Doc comment changes only. The changes fall into four kinds: - missing `@docImport` directives - qualified member references, e.g. `[value]` → `[MaterialStatesController.value]` - a constructor parameter in backticks instead of brackets (`liveRegion`) - references to names that do not exist, reworded (`child`, `enabled` in `cupertino/menu_anchor.dart`) Towards flutter#192870 — enabling the `comment_references` lint.
1 parent a89783e commit 734b4de

12 files changed

Lines changed: 44 additions & 27 deletions

‎packages/flutter/lib/src/cupertino/menu_anchor.dart‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ class _FocusLastAction extends ContextAction<_FocusLastIntent> {
15191519
///
15201520
/// The default thickness of the divider is 1 physical pixel.
15211521
class _CupertinoMenuImplicitDivider extends StatelessWidget {
1522-
/// Draws a [_CupertinoMenuImplicitDivider] below a [child].
1522+
/// Draws a [_CupertinoMenuImplicitDivider] below a menu item.
15231523
const _CupertinoMenuImplicitDivider();
15241524

15251525
/// The default color applied to the [_CupertinoMenuImplicitDivider] with
@@ -1942,7 +1942,8 @@ class CupertinoMenuItem extends StatelessWidget implements CupertinoMenuEntry {
19421942
);
19431943

19441944
/// Resolves the title [TextStyle] in response to
1945-
/// [CupertinoThemeData.brightness], [isDestructiveAction], and [enabled].
1945+
/// [CupertinoThemeData.brightness], [isDestructiveAction], and whether
1946+
/// [onPressed] is null.
19461947
//
19471948
// Approximated from the iOS and iPadOS 18.5 simulators.
19481949
TextStyle _resolveDefaultTextStyle(BuildContext context, TextScaler textScaler) {

‎packages/flutter/lib/src/material/date.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
/// @docImport 'calendar_date_picker.dart';
66
/// @docImport 'date_picker.dart';
7+
/// @docImport 'input_date_picker_form_field.dart';
78
/// @docImport 'text_field.dart';
89
library;
910

‎packages/flutter/lib/src/material/expansion_tile.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
/// @docImport 'circle_avatar.dart';
6+
/// @docImport 'ink_well.dart';
67
/// @docImport 'text_theme.dart';
78
library;
89

‎packages/flutter/lib/src/material/input_decorator.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
///
77
/// @docImport 'dropdown.dart';
88
/// @docImport 'ink_well.dart';
9+
/// @docImport 'tabs.dart';
910
/// @docImport 'text_field.dart';
1011
/// @docImport 'text_form_field.dart';
1112
library;

‎packages/flutter/lib/src/material/material_button.dart‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/// @docImport 'elevated_button.dart';
66
/// @docImport 'elevated_button_theme.dart';
7+
/// @docImport 'filled_button.dart';
8+
/// @docImport 'filled_button_theme.dart';
79
/// @docImport 'icon_button.dart';
810
/// @docImport 'outlined_button.dart';
911
/// @docImport 'outlined_button_theme.dart';

‎packages/flutter/lib/src/material/material_state.dart‎

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ typedef MaterialPropertyResolver<T> = WidgetPropertyResolver<T>;
103103
/// value will be used for all states.
104104
///
105105
/// To define a `const` [MaterialStateColor], you'll need to extend
106-
/// [MaterialStateColor] and override its [resolve] method. You'll also need
107-
/// to provide a `defaultValue` to the super constructor, so that we can know
108-
/// at compile-time what its default color is.
106+
/// [MaterialStateColor] and override its [MaterialStateColor.resolve] method.
107+
/// You'll also need to provide a `defaultValue` to the super constructor, so
108+
/// that we can know at compile-time what its default color is.
109109
///
110110
/// {@tool snippet}
111111
///
@@ -265,9 +265,9 @@ typedef MaterialStateOutlinedBorder = WidgetStateOutlinedBorder;
265265
/// value will be used for all states.
266266
///
267267
/// To define a `const` [MaterialStateTextStyle], you'll need to extend
268-
/// [MaterialStateTextStyle] and override its [resolve] method. You'll also need
269-
/// to provide a `defaultValue` to the super constructor, so that we can know
270-
/// at compile-time what its default color is.
268+
/// [MaterialStateTextStyle] and override its [MaterialStateTextStyle.resolve]
269+
/// method. You'll also need to provide a `defaultValue` to the super
270+
/// constructor, so that we can know at compile-time what its default color is.
271271
///
272272
/// See also:
273273
///
@@ -500,8 +500,8 @@ class _WidgetInputBorderMapper extends WidgetStateMapper<InputBorder>
500500
const _WidgetInputBorderMapper(super.map);
501501
}
502502

503-
/// Interface for classes that [resolve] to a value of type `T` based
504-
/// on a widget's interactive "state", which is defined as a set
503+
/// Interface for classes that [MaterialStateProperty.resolve] to a value of
504+
/// type `T` based on a widget's interactive "state", which is defined as a set
505505
/// of [MaterialState]s.
506506
///
507507
/// {@youtube 560 315 https://www.youtube.com/watch?v=CylXr3AF3uU}
@@ -511,14 +511,14 @@ class _WidgetInputBorderMapper extends WidgetStateMapper<InputBorder>
511511
/// [WidgetState.focused], [WidgetState.hovered], [WidgetState.pressed]. For
512512
/// example the [InkWell.overlayColor] defines the color that fills the ink well
513513
/// when it's pressed (the "splash color"), focused, or hovered. The [InkWell]
514-
/// uses the overlay color's [resolve] method to compute the color for the
515-
/// ink well's current state.
514+
/// uses the overlay color's [MaterialStateProperty.resolve] method to compute
515+
/// the color for the ink well's current state.
516516
///
517517
/// [ButtonStyle], which is used to configure the appearance of
518518
/// buttons like [TextButton], [ElevatedButton], and [OutlinedButton],
519519
/// has many material state properties. The button widgets keep track
520-
/// of their current material state and [resolve] the button style's
521-
/// material state properties when their value is needed.
520+
/// of their current material state and [MaterialStateProperty.resolve] the
521+
/// button style's material state properties when their value is needed.
522522
///
523523
/// {@tool dartpad}
524524
/// This example shows how you can override the default text and icon
@@ -562,25 +562,28 @@ typedef MaterialStatePropertyAll<T> = WidgetStatePropertyAll<T>;
562562
/// extensions that add support for additional states. See
563563
/// [TextButton] for an example.
564564
///
565-
/// The controller's [value] is its current set of states. Listeners
566-
/// are notified whenever the [value] changes. The [value] should only be
567-
/// changed with [update]; it should not be modified directly.
565+
/// The controller's [MaterialStatesController.value] is its current set of
566+
/// states. Listeners are notified whenever the
567+
/// [MaterialStatesController.value] changes. The
568+
/// [MaterialStatesController.value] should only be changed with
569+
/// [MaterialStatesController.update]; it should not be modified directly.
568570
///
569-
/// The controller's [value] represents the set of states that a
570-
/// widget's visual properties, typically [MaterialStateProperty]
571+
/// The controller's [MaterialStatesController.value] represents the set of
572+
/// states that a widget's visual properties, typically [MaterialStateProperty]
571573
/// values, are resolved against. It is _not_ the intrinsic state of
572574
/// the widget. The widget is responsible for ensuring that the
573-
/// controller's [value] tracks its intrinsic state. For example one
574-
/// cannot request the keyboard focus for a widget by adding
575-
/// [WidgetState.focused] to its controller. When the widget gains the
576-
/// or loses the focus it will [update] its controller's [value] and
577-
/// notify listeners of the change.
575+
/// controller's [MaterialStatesController.value] tracks its intrinsic state.
576+
/// For example one cannot request the keyboard focus for a widget by adding
577+
/// [WidgetState.focused] to its controller. When the widget gains or loses the
578+
/// focus it will [MaterialStatesController.update] its controller's
579+
/// [MaterialStatesController.value] and notify listeners of the change.
578580
///
579581
/// When calling `setState` in a [MaterialStatesController] listener, use the
580582
/// [SchedulerBinding.addPostFrameCallback] to delay the call to `setState` after
581583
/// the frame has been rendered. It's generally prudent to use the
582584
/// [SchedulerBinding.addPostFrameCallback] because some of the widgets that
583-
/// depend on [MaterialStatesController] may call [update] in their build method.
585+
/// depend on [MaterialStatesController] may call
586+
/// [MaterialStatesController.update] in their build method.
584587
/// In such cases, listener's that call `setState` - during the build phase - will cause
585588
/// an error.
586589
///

‎packages/flutter/lib/src/material/range_slider_parts.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/// @docImport 'color_scheme.dart';
66
/// @docImport 'range_slider.dart';
77
/// @docImport 'text_theme.dart';
8+
/// @docImport 'theme_data.dart';
89
library;
910

1011
import 'dart:math' as math;

‎packages/flutter/lib/src/material/slider_parts.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
/// @docImport 'color_scheme.dart';
6+
/// @docImport 'range_slider.dart';
67
/// @docImport 'slider.dart';
78
/// @docImport 'text_theme.dart';
89
library;

‎packages/flutter/lib/src/material/slider_value_indicator_shape.dart‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'range_slider.dart';
6+
/// @docImport 'slider_parts.dart';
7+
library;
8+
59
import 'dart:math' as math;
610

711
import 'package:flutter/foundation.dart';

‎packages/flutter/lib/src/material/text_field.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ typedef InputCounterWidgetBuilder = Widget? Function(
5050
required int? maxLength,
5151

5252
/// Whether or not the TextField is currently focused. Mainly provided for
53-
/// the [liveRegion] parameter in the [Semantics] widget for accessibility.
53+
/// the `liveRegion` parameter in the [Semantics] widget for accessibility.
5454
required bool isFocused,
5555
});
5656

0 commit comments

Comments
 (0)