Skip to content

Commit 11f9c59

Browse files
authored
[material_ui, cupertino_ui] Migrate macros that contain @tool (#12271)
See flutter/flutter#189629. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent e6b99e0 commit 11f9c59

8 files changed

Lines changed: 80 additions & 12 deletions

File tree

‎packages/cupertino_ui/lib/src/scrollbar.dart‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ const double _kScrollbarCrossAxisMargin = 3.0;
3737
///
3838
/// Learn more about [CupertinoScrollbar] on the [Flutter YouTube channel](https://www.youtube.com/watch?v=DbkIQSvwnZc).
3939
///
40-
/// {@macro flutter.widgets.Scrollbar}
40+
/// For more information, see [RawScrollbar].
41+
// TODO(dkwingsmt): Migrate the doc back to macro
42+
// flutter.widgets.Scrollbar
43+
// https://github.com/flutter/flutter/issues/189629
4144
///
4245
/// When dragging a [CupertinoScrollbar] thumb, the thickness and radius will
4346
/// animate from [thickness] and [radius] to [thicknessWhileDragging] and

‎packages/cupertino_ui/lib/src/text_field.dart‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,13 @@ class CupertinoTextField extends StatefulWidget {
700700
/// {@macro flutter.services.textFormatter.maxLengthEnforcement}
701701
final MaxLengthEnforcement? maxLengthEnforcement;
702702

703-
/// {@macro flutter.widgets.editableText.onChanged}
703+
/// Called when the user initiates a change to the TextField's
704+
/// value: when they have inserted or deleted text.
705+
///
706+
/// For more information, see [EditableText.onChanged].
707+
// TODO(dkwingsmt): Migrate the doc back to macro
708+
// flutter.widgets.editableText.onChanged
709+
// https://github.com/flutter/flutter/issues/189629
704710
final ValueChanged<String>? onChanged;
705711

706712
/// {@macro flutter.widgets.editableText.onEditingComplete}
@@ -865,10 +871,21 @@ class CupertinoTextField extends StatefulWidget {
865871
/// {@macro flutter.services.TextInputConfiguration.enableInlinePrediction}
866872
final bool? enableInlinePrediction;
867873

868-
/// {@macro flutter.widgets.editableText.contentInsertionConfiguration}
874+
/// Configuration of handler for media content inserted via the system input
875+
/// method.
876+
///
877+
/// For more information, see [EditableText.contentInsertionConfiguration].
878+
// TODO(dkwingsmt): Migrate the doc back to macro
879+
// flutter.widgets.editableText.contentInsertionConfiguration
880+
// https://github.com/flutter/flutter/issues/189629
869881
final ContentInsertionConfiguration? contentInsertionConfiguration;
870882

871-
/// {@macro flutter.widgets.EditableText.contextMenuBuilder}
883+
/// Builds the text selection toolbar when requested by the user.
884+
///
885+
/// For more information, see [EditableText.contextMenuBuilder].
886+
// TODO(dkwingsmt): Migrate the doc back to macro
887+
// flutter.widgets.EditableText.contextMenuBuilder
888+
// https://github.com/flutter/flutter/issues/189629
872889
///
873890
/// If not provided, will build a default menu based on the platform.
874891
///
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Use this file as a template to draft an unreleased changelog file.
2+
# Make a copy of this file in the same directory, give it an appropriate name, and fill in the details.
3+
changelog: |
4+
- Fix API doc by clearing unsupported directives introduced by macros.
5+
version: patch

‎packages/material_ui/lib/src/autocomplete.dart‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ class Autocomplete<T extends Object> extends StatelessWidget {
113113

114114
/// The [FocusNode] that is used for the text field.
115115
///
116-
/// {@macro flutter.widgets.RawAutocomplete.split}
116+
/// For more information, see [RawAutocomplete.focusNode].
117+
// TODO(dkwingsmt): Migrate the doc back to macro
118+
// flutter.widgets.RawAutocomplete.split
119+
// https://github.com/flutter/flutter/issues/189629
117120
///
118121
/// If this parameter is not null, then [textEditingController] must also be
119122
/// non-null.
@@ -144,7 +147,10 @@ class Autocomplete<T extends Object> extends StatelessWidget {
144147

145148
/// The [TextEditingController] that is used for the text field.
146149
///
147-
/// {@macro flutter.widgets.RawAutocomplete.split}
150+
/// For more information, see [RawAutocomplete.textEditingController].
151+
// TODO(dkwingsmt): Migrate the doc back to macro
152+
// flutter.widgets.RawAutocomplete.split
153+
// https://github.com/flutter/flutter/issues/189629
148154
///
149155
/// If this parameter is not null, then [focusNode] must also be non-null.
150156
final TextEditingController? textEditingController;

‎packages/material_ui/lib/src/reorderable_list.dart‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,12 @@ class ReorderableListView extends StatefulWidget {
333333
/// {@macro flutter.widgets.scroll_view.shrinkWrap}
334334
final bool shrinkWrap;
335335

336-
/// {@macro flutter.widgets.scroll_view.anchor}
336+
/// The relative position of the zero scroll offset.
337+
///
338+
/// For more information, see [ScrollView.anchor].
339+
// TODO(dkwingsmt): Migrate the doc back to macro
340+
// flutter.widgets.scroll_view.anchor
341+
// https://github.com/flutter/flutter/issues/189629
337342
final double anchor;
338343

339344
/// {@macro flutter.rendering.RenderViewportBase.cacheExtent}

‎packages/material_ui/lib/src/scrollbar.dart‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600);
2424
///
2525
/// Learn more about [Scrollbar] on the [Flutter YouTube channel](https://www.youtube.com/watch?v=DbkIQSvwnZc).
2626
///
27-
/// {@macro flutter.widgets.Scrollbar}
27+
/// For more information, see [RawScrollbar].
28+
// TODO(dkwingsmt): Migrate the doc back to macro
29+
// flutter.widgets.Scrollbar
30+
// https://github.com/flutter/flutter/issues/189629
2831
///
2932
/// Dynamically changes to a [CupertinoScrollbar], an iOS style scrollbar, by
3033
/// default on the iOS platform.
@@ -111,10 +114,21 @@ class Scrollbar extends StatelessWidget {
111114
/// {@macro flutter.widgets.Scrollbar.child}
112115
final Widget child;
113116

114-
/// {@macro flutter.widgets.Scrollbar.controller}
117+
/// The [ScrollController] used to implement Scrollbar dragging.
118+
///
119+
/// For more information, see [RawScrollbar.controller].
120+
// TODO(dkwingsmt): Migrate the doc back to macro
121+
// flutter.widgets.Scrollbar.controller
122+
// https://github.com/flutter/flutter/issues/189629
115123
final ScrollController? controller;
116124

117-
/// {@macro flutter.widgets.Scrollbar.thumbVisibility}
125+
/// Indicates that the scrollbar thumb should be visible, even when a scroll
126+
/// is not underway.
127+
///
128+
/// For more information, see [RawScrollbar.thumbVisibility].
129+
// TODO(dkwingsmt): Migrate the doc back to macro
130+
// flutter.widgets.Scrollbar.thumbVisibility
131+
// https://github.com/flutter/flutter/issues/189629
118132
///
119133
/// If this property is null, then [ScrollbarThemeData.thumbVisibility] of
120134
/// [ThemeData.scrollbarTheme] is used. If that is also null, the default value

‎packages/material_ui/lib/src/text_field.dart‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,13 @@ class TextField extends StatefulWidget {
607607
/// {@macro flutter.services.textFormatter.maxLengthEnforcement}
608608
final MaxLengthEnforcement? maxLengthEnforcement;
609609

610-
/// {@macro flutter.widgets.editableText.onChanged}
610+
/// Called when the user initiates a change to the TextField's
611+
/// value: when they have inserted or deleted text.
612+
///
613+
/// For more information, see [EditableText.onChanged].
614+
// TODO(dkwingsmt): Migrate the doc back to macro
615+
// flutter.widgets.editableText.onChanged
616+
// https://github.com/flutter/flutter/issues/189629
611617
///
612618
/// See also:
613619
///
@@ -863,7 +869,14 @@ class TextField extends StatefulWidget {
863869
/// {@macro flutter.services.TextInputConfiguration.enableInlinePrediction}
864870
final bool? enableInlinePrediction;
865871

866-
/// {@macro flutter.widgets.editableText.contentInsertionConfiguration}
872+
/// Configuration of handler for media content inserted via the system input
873+
/// method.
874+
///
875+
/// For more information, see
876+
/// [EditableText.contentInsertionConfiguration].
877+
// TODO(dkwingsmt): Migrate the doc back to macro
878+
// flutter.widgets.editableText.contentInsertionConfiguration
879+
// https://github.com/flutter/flutter/issues/189629
867880
final ContentInsertionConfiguration? contentInsertionConfiguration;
868881

869882
/// {@macro flutter.widgets.EditableText.contextMenuBuilder}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Use this file as a template to draft an unreleased changelog file.
2+
# Make a copy of this file in the same directory, give it an appropriate name, and fill in the details.
3+
changelog: |
4+
- Fix API doc by clearing unsupported directives introduced by macros.
5+
version: patch

0 commit comments

Comments
 (0)