Unverified Commit 4b4287ba authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Make it an error to break macros in docs (and fix existing broken macros) (#62071)

parent cac22cdb
...@@ -12,3 +12,10 @@ dartdoc: ...@@ -12,3 +12,10 @@ dartdoc:
dartpad: dartpad:
command: ["dev/snippets/lib/main.dart", "--type=sample", "--dartpad"] command: ["dev/snippets/lib/main.dart", "--type=sample", "--dartpad"]
description: "Creates full application sample code documentation output from embedded documentation samples and displays it in an embedded DartPad." description: "Creates full application sample code documentation output from embedded documentation samples and displays it in an embedded DartPad."
errors:
- tool-error # enabled by default
- duplicate-file # enabled by default
- invalid-parameter # enabled by default
- unresolved-export # enabled by default
- unknown-macro # a {@macro foo} reference cannot be resolved
- invalid-parameter # an invalid parameter is passed to a {@foo x y} directive
...@@ -119,7 +119,7 @@ class RawMaterialButton extends StatefulWidget { ...@@ -119,7 +119,7 @@ class RawMaterialButton extends StatefulWidget {
/// * [MaterialState.disabled]. /// * [MaterialState.disabled].
/// ///
/// If this property is null, [MaterialStateMouseCursor.clickable] will be used. /// If this property is null, [MaterialStateMouseCursor.clickable] will be used.
/// {@endtemplate flutter.material.button.mouseCursor} /// {@endtemplate}
final MouseCursor mouseCursor; final MouseCursor mouseCursor;
/// Defines the default text style, with [Material.textStyle], for the /// Defines the default text style, with [Material.textStyle], for the
......
...@@ -245,7 +245,7 @@ class ColorScheme with Diagnosticable { ...@@ -245,7 +245,7 @@ class ColorScheme with Diagnosticable {
/// Linearly interpolate between two [ColorScheme] objects. /// Linearly interpolate between two [ColorScheme] objects.
/// ///
/// {@macro flutter.material.themeData.lerp} /// {@macro dart.ui.shadow.lerp}
static ColorScheme lerp(ColorScheme a, ColorScheme b, double t) { static ColorScheme lerp(ColorScheme a, ColorScheme b, double t) {
return ColorScheme( return ColorScheme(
primary: Color.lerp(a.primary, b.primary, t), primary: Color.lerp(a.primary, b.primary, t),
......
...@@ -278,7 +278,7 @@ class IconButton extends StatelessWidget { ...@@ -278,7 +278,7 @@ class IconButton extends StatelessWidget {
/// If this is set to null, the button will be disabled. /// If this is set to null, the button will be disabled.
final VoidCallback onPressed; final VoidCallback onPressed;
/// {@macro flutter.material.inkwell.mousecursor} /// {@macro flutter.material.button.mouseCursor}
/// ///
/// Defaults to [SystemMouseCursors.click]. /// Defaults to [SystemMouseCursors.click].
final MouseCursor mouseCursor; final MouseCursor mouseCursor;
......
...@@ -126,7 +126,7 @@ class ScaffoldPrelayoutGeometry { ...@@ -126,7 +126,7 @@ class ScaffoldPrelayoutGeometry {
/// The minimum padding to inset the [FloatingActionButton] by for it /// The minimum padding to inset the [FloatingActionButton] by for it
/// to remain visible. /// to remain visible.
/// ///
/// This value is the result of calling [MediaQuery.padding] in the /// This value is the result of calling [MediaQueryData.padding] in the
/// [Scaffold]'s [BuildContext], /// [Scaffold]'s [BuildContext],
/// and is useful for insetting the [FloatingActionButton] to avoid features like /// and is useful for insetting the [FloatingActionButton] to avoid features like
/// the system status bar or the keyboard. /// the system status bar or the keyboard.
......
...@@ -685,7 +685,7 @@ class TextTheme with Diagnosticable { ...@@ -685,7 +685,7 @@ class TextTheme with Diagnosticable {
/// Linearly interpolate between two text themes. /// Linearly interpolate between two text themes.
/// ///
/// {@macro flutter.material.themeData.lerp} /// {@macro dart.ui.shadow.lerp}
static TextTheme lerp(TextTheme a, TextTheme b, double t) { static TextTheme lerp(TextTheme a, TextTheme b, double t) {
assert(t != null); assert(t != null);
return TextTheme( return TextTheme(
......
...@@ -330,7 +330,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin { ...@@ -330,7 +330,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
markNeedsTextLayout(); markNeedsTextLayout();
} }
/// {@macro flutter.widgets.text.DefaultTextStyle.textWidthBasis} /// {@macro flutter.painting.textPainter.textWidthBasis}
TextWidthBasis get textWidthBasis => _textPainter.textWidthBasis; TextWidthBasis get textWidthBasis => _textPainter.textWidthBasis;
set textWidthBasis(TextWidthBasis value) { set textWidthBasis(TextWidthBasis value) {
assert(value != null); assert(value != null);
......
...@@ -269,7 +269,7 @@ class RenderParagraph extends RenderBox ...@@ -269,7 +269,7 @@ class RenderParagraph extends RenderBox
markNeedsLayout(); markNeedsLayout();
} }
/// {@macro flutter.widgets.basic.TextWidthBasis} /// {@macro flutter.painting.textPainter.textWidthBasis}
TextWidthBasis get textWidthBasis => _textPainter.textWidthBasis; TextWidthBasis get textWidthBasis => _textPainter.textWidthBasis;
set textWidthBasis(TextWidthBasis value) { set textWidthBasis(TextWidthBasis value) {
assert(value != null); assert(value != null);
......
...@@ -210,7 +210,11 @@ class RawKeyEventDataWindows extends RawKeyEventData { ...@@ -210,7 +210,11 @@ class RawKeyEventDataWindows extends RawKeyEventData {
/// This mask is used to check the [modifiers] field to test whether one of the /// This mask is used to check the [modifiers] field to test whether one of the
/// SHIFT modifier keys is pressed. /// SHIFT modifier keys is pressed.
/// ///
/// {@macro flutter.services.rawKeyEventDataWindows.modifiers} /// {@template flutter.services.rawKeyEventDataWindows.modifiers}
/// Use this value if you need to decode the [modifiers] field yourself, but
/// it's much easier to use [isModifierPressed] if you just want to know if
/// a modifier is pressed.
/// {@endtemplate}
static const int modifierShift = 1 << 0; static const int modifierShift = 1 << 0;
/// This mask is used to check the [modifiers] field to test whether the left /// This mask is used to check the [modifiers] field to test whether the left
......
...@@ -5271,7 +5271,7 @@ class RichText extends MultiChildRenderObjectWidget { ...@@ -5271,7 +5271,7 @@ class RichText extends MultiChildRenderObjectWidget {
/// {@macro flutter.painting.textPainter.strutStyle} /// {@macro flutter.painting.textPainter.strutStyle}
final StrutStyle strutStyle; final StrutStyle strutStyle;
/// {@macro flutter.widgets.text.DefaultTextStyle.textWidthBasis} /// {@macro flutter.painting.textPainter.textWidthBasis}
final TextWidthBasis textWidthBasis; final TextWidthBasis textWidthBasis;
/// {@macro flutter.dart:ui.textHeightBehavior} /// {@macro flutter.dart:ui.textHeightBehavior}
......
...@@ -695,7 +695,7 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB ...@@ -695,7 +695,7 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB
/// A future that completes when the Flutter engine has rasterized the first /// A future that completes when the Flutter engine has rasterized the first
/// frame. /// frame.
/// ///
/// {@macro flutter.frame_rasterize_vs_presented} /// {@macro flutter.frame_rasterized_vs_presented}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -518,7 +518,7 @@ class EditableText extends StatefulWidget { ...@@ -518,7 +518,7 @@ class EditableText extends StatefulWidget {
/// {@macro flutter.dart:ui.textHeightBehavior}, /// {@macro flutter.dart:ui.textHeightBehavior},
final TextHeightBehavior textHeightBehavior; final TextHeightBehavior textHeightBehavior;
/// {@macro flutter.widgets.text.DefaultTextStyle.textWidthBasis} /// {@macro flutter.painting.textPainter.textWidthBasis}
final TextWidthBasis textWidthBasis; final TextWidthBasis textWidthBasis;
/// {@template flutter.widgets.editableText.readOnly} /// {@template flutter.widgets.editableText.readOnly}
...@@ -685,6 +685,7 @@ class EditableText extends StatefulWidget { ...@@ -685,6 +685,7 @@ class EditableText extends StatefulWidget {
/// See [RenderEditable.locale] for more information. /// See [RenderEditable.locale] for more information.
final Locale locale; final Locale locale;
/// {@template flutter.widgets.editableText.textScaleFactor}
/// The number of font pixels for each logical pixel. /// The number of font pixels for each logical pixel.
/// ///
/// For example, if the text scale factor is 1.5, text will be 50% larger than /// For example, if the text scale factor is 1.5, text will be 50% larger than
...@@ -692,6 +693,7 @@ class EditableText extends StatefulWidget { ...@@ -692,6 +693,7 @@ class EditableText extends StatefulWidget {
/// ///
/// Defaults to the [MediaQueryData.textScaleFactor] obtained from the ambient /// Defaults to the [MediaQueryData.textScaleFactor] obtained from the ambient
/// [MediaQuery], or 1.0 if there is no [MediaQuery] in scope. /// [MediaQuery], or 1.0 if there is no [MediaQuery] in scope.
/// {@endtemplate}
final double textScaleFactor; final double textScaleFactor;
/// The color to use when painting the cursor. /// The color to use when painting the cursor.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment