Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Standardize macro names for dartdoc macros #22180

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/ui/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ part of dart.ui;
// which can not be rendered by Skia.

// Update this list when changing the list of supported codecs.
/// {@template dart.ui.imageFormats}
/// JPEG, PNG, GIF, Animated GIF, WebP, Animated WebP, BMP, and WBMP. Additional
/// formats may be supported by the underlying platform. Flutter will
/// attempt to call platform API to decode unrecognized formats, and if the
/// platform API supports decoding the image Flutter will be able to render it.
/// {@endtemplate}

// TODO(gspencergoog): remove this template block once the framework templates
// are renamed to not reference it.
/// {@template flutter.dart:ui.imageFormats}
/// JPEG, PNG, GIF, Animated GIF, WebP, Animated WebP, BMP, and WBMP. Additional
/// formats may be supported by the underlying platform. Flutter will
Expand Down Expand Up @@ -1960,7 +1969,7 @@ class Codec extends NativeFieldWrapperClass2 {
///
/// The `list` parameter is the binary image data (e.g a PNG or GIF binary data).
/// The data can be for either static or animated images. The following image
/// formats are supported: {@macro flutter.dart:ui.imageFormats}
/// formats are supported: {@macro dart.ui.imageFormats}
///
/// The `targetWidth` and `targetHeight` arguments specify the size of the
/// output image, in image pixels. If they are not equal to the intrinsic
Expand Down
4 changes: 0 additions & 4 deletions lib/ui/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ class PlatformDispatcher {

/// A callback invoked when any view begins a frame.
///
/// {@template flutter.foundation.PlatformDispatcher.onBeginFrame}
/// A callback that is invoked to notify the application that it is an
/// appropriate time to provide a scene using the [SceneBuilder] API and the
/// [FlutterView.render] method.
Expand All @@ -218,7 +217,6 @@ class PlatformDispatcher {
/// screen with the highest VSync rate. This is only called if
/// [PlatformDispatcher.scheduleFrame] has been called since the last time
/// this callback was invoked.
/// {@endtemplate}
FrameCallback? get onBeginFrame => _onBeginFrame;
FrameCallback? _onBeginFrame;
Zone _onBeginFrameZone = Zone.root;
Expand All @@ -236,13 +234,11 @@ class PlatformDispatcher {
);
}

/// {@template flutter.foundation.PlatformDispatcher.onDrawFrame}
/// A callback that is invoked for each frame after [onBeginFrame] has
/// completed and after the microtask queue has been drained.
///
/// This can be used to implement a second phase of frame rendering that
/// happens after any deferred work queued by the [onBeginFrame] phase.
/// {@endtemplate}
VoidCallback? get onDrawFrame => _onDrawFrame;
VoidCallback? _onDrawFrame;
Zone _onDrawFrameZone = Zone.root;
Expand Down
20 changes: 16 additions & 4 deletions lib/ui/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ enum TextDecorationStyle {
wavy
}

/// {@template flutter.dart:ui.textHeightBehavior}
/// {@template dart.ui.textHeightBehavior}
/// Defines how the paragraph will apply [TextStyle.height] to the ascent of the
/// first line and descent of the last line.
///
Expand Down Expand Up @@ -1638,7 +1638,7 @@ enum BoxHeightStyle {
/// The top and bottom of each box will cover half of the
/// space above and half of the space below the line.
///
/// {@template flutter.dart:ui.boxHeightStyle.includeLineSpacing}
/// {@template dart.ui.boxHeightStyle.includeLineSpacing}
/// The top edge of each line should be the same as the bottom edge
/// of the line above. There should be no gaps in vertical coverage given any
/// amount of line spacing. Line spacing is not included above the first line
Expand All @@ -1650,14 +1650,14 @@ enum BoxHeightStyle {
///
/// The line spacing will be added to the top of the box.
///
/// {@macro flutter.dart:ui.boxHeightStyle.includeLineSpacing}
/// {@macro dart.ui.boxHeightStyle.includeLineSpacing}
includeLineSpacingTop,

/// Extends the bottom edge of the bounds to fully cover any line spacing.
///
/// The line spacing will be added to the bottom of the box.
///
/// {@macro flutter.dart:ui.boxHeightStyle.includeLineSpacing}
/// {@macro dart.ui.boxHeightStyle.includeLineSpacing}
includeLineSpacingBottom,

/// Calculate box heights based on the metrics of this paragraph's [StrutStyle].
Expand Down Expand Up @@ -2280,4 +2280,16 @@ FutureOr<void> _sendFontChangeMessage() async {
);
}

// TODO(gspencergoog): remove this template block once the framework templates
// are renamed to not reference it.
/// {@template flutter.dart:ui.textHeightBehavior}
/// Defines how the paragraph will apply [TextStyle.height] to the ascent of the
/// first line and descent of the last line.
///
/// Each boolean value represents whether the [TextStyle.height] modifier will
/// be applied to the corresponding metric. By default, all properties are true,
/// and [TextStyle.height] is applied as normal. When set to false, the font's
/// default ascent will be used.
/// {@endtemplate}

String _loadFontFromList(Uint8List list, _Callback<void> callback, String? fontFamily) native 'loadFontFromList';
48 changes: 24 additions & 24 deletions lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// [physicalSize], [padding], [viewInsets], [PlatformDispatcher.views], or
/// [systemGestureInsets] values change.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// See [PlatformDispatcher.onMetricsChanged] for more information.
VoidCallback? get onMetricsChanged => platformDispatcher.onMetricsChanged;
Expand All @@ -322,7 +322,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// The system-reported default locale of the device.
///
/// {@template flutter.lib.ui.window.accessorForwardWarning}
/// {@template dart.ui.window.accessorForwardWarning}
/// Accessing this value returns the value contained in the
/// [PlatformDispatcher] singleton, so instead of getting it from here, you
/// should consider getting it from `WidgetsBinding.instance.platformDispatcher` instead
Expand All @@ -344,7 +344,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// The full system-reported supported locales of the device.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// This establishes the language and formatting conventions that window
/// should, if possible, use to render their user interface.
Expand Down Expand Up @@ -374,7 +374,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// A callback that is invoked whenever [locale] changes value.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// The framework invokes this callback in the same zone in which the
/// callback was set.
Expand All @@ -390,7 +390,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// The lifecycle state immediately after dart isolate initialization.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// This property will not be updated as the lifecycle changes.
///
Expand All @@ -400,7 +400,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// The system-reported text scale.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// This establishes the text scaling factor to use when rendering text,
/// according to the user's platform preferences.
Expand All @@ -417,14 +417,14 @@ class SingletonFlutterWindow extends FlutterWindow {
/// The setting indicating whether time should always be shown in the 24-hour
/// format.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// This option is used by [showTimePicker].
bool get alwaysUse24HourFormat => platformDispatcher.alwaysUse24HourFormat;

/// A callback that is invoked whenever [textScaleFactor] changes value.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// The framework invokes this callback in the same zone in which the
/// callback was set.
Expand All @@ -440,15 +440,15 @@ class SingletonFlutterWindow extends FlutterWindow {

/// The setting indicating the current brightness mode of the host platform.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// If the platform has no preference, [platformBrightness] defaults to
/// [Brightness.light].
Brightness get platformBrightness => platformDispatcher.platformBrightness;

/// A callback that is invoked whenever [platformBrightness] changes value.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// The framework invokes this callback in the same zone in which the
/// callback was set.
Expand All @@ -466,7 +466,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// time to provide a scene using the [SceneBuilder] API and the [render]
/// method.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// When possible, this is driven by the hardware VSync signal. This is only
/// called if [scheduleFrame] has been called since the last time this
Expand All @@ -493,7 +493,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// A callback that is invoked for each frame after [onBeginFrame] has
/// completed and after the microtask queue has been drained.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// This can be used to implement a second phase of frame rendering that
/// happens after any deferred work queued by the [onBeginFrame] phase.
Expand All @@ -515,7 +515,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// A callback that is invoked to report the [FrameTiming] of recently
/// rasterized frames.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// It's prefered to use [SchedulerBinding.addTimingsCallback] than to use
/// [SingletonFlutterWindow.onReportTimings] directly because
Expand All @@ -542,7 +542,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// A callback that is invoked when pointer data is available.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// The framework invokes this callback in the same zone in which the
/// callback was set.
Expand All @@ -559,7 +559,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// The route or path that the embedder requested when the application was
/// launched.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// This will be the string "`/`" if no particular route was requested.
///
Expand Down Expand Up @@ -589,7 +589,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// Requests that, at the next appropriate opportunity, the [onBeginFrame] and
/// [onDrawFrame] callbacks be invoked.
///
/// {@template flutter.lib.ui.window.functionForwardWarning}
/// {@template dart.ui.window.functionForwardWarning}
/// Calling this function forwards the call to the same function on the
/// [PlatformDispatcher] singleton, so instead of calling it here, you should
/// consider calling it on `WidgetsBinding.instance.platformDispatcher` instead (or, when
Expand All @@ -607,15 +607,15 @@ class SingletonFlutterWindow extends FlutterWindow {
/// Whether the user has requested that [updateSemantics] be called when
/// the semantic contents of window changes.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// The [onSemanticsEnabledChanged] callback is called whenever this value
/// changes.
bool get semanticsEnabled => platformDispatcher.semanticsEnabled;

/// A callback that is invoked when the value of [semanticsEnabled] changes.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// The framework invokes this callback in the same zone in which the
/// callback was set.
Expand All @@ -627,7 +627,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// A callback that is invoked whenever the user requests an action to be
/// performed.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// This callback is used when the user expresses the action they wish to
/// perform based on the semantics supplied by [updateSemantics].
Expand All @@ -644,7 +644,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// A callback that is invoked when the value of [accessibilityFeatures] changes.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// The framework invokes this callback in the same zone in which the
/// callback was set.
Expand All @@ -655,7 +655,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// Change the retained semantics data about this window.
///
/// {@macro flutter.lib.ui.window.functionForwardWarning}
/// {@macro dart.ui.window.functionForwardWarning}
///
/// If [semanticsEnabled] is true, the user has requested that this function
/// be called whenever the semantic content of this window changes.
Expand All @@ -666,7 +666,7 @@ class SingletonFlutterWindow extends FlutterWindow {

/// Sends a message to a platform-specific plugin.
///
/// {@macro flutter.lib.ui.window.functionForwardWarning}
/// {@macro dart.ui.window.functionForwardWarning}
///
/// The `name` parameter determines which plugin receives the message. The
/// `data` parameter contains the message payload and is typically UTF-8
Expand All @@ -684,7 +684,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// Called whenever this window receives a message from a platform-specific
/// plugin.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// The `name` parameter determines which plugin sent the message. The `data`
/// parameter is the payload and is typically UTF-8 encoded JSON but can be
Expand All @@ -704,7 +704,7 @@ class SingletonFlutterWindow extends FlutterWindow {
/// Set the debug name associated with this platform dispatcher's root
/// isolate.
///
/// {@macro flutter.lib.ui.window.accessorForwardWarning}
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// Normally debug names are automatically generated from the Dart port, entry
/// point, and source file. For example: `main.dart$main-1234`.
Expand Down
4 changes: 0 additions & 4 deletions lib/web_ui/lib/src/engine/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,13 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {

/// A callback invoked when any window begins a frame.
///
/// {@template flutter.foundation.PlatformDispatcher.onBeginFrame}
/// A callback that is invoked to notify the application that it is an
/// appropriate time to provide a scene using the [SceneBuilder] API and the
/// [PlatformWindow.render] method.
/// When possible, this is driven by the hardware VSync signal of the attached
/// screen with the highest VSync rate. This is only called if
/// [PlatformWindow.scheduleFrame] has been called since the last time this
/// callback was invoked.
/// {@endtemplate}
@override
ui.FrameCallback? get onBeginFrame => _onBeginFrame;
ui.FrameCallback? _onBeginFrame;
Expand All @@ -126,13 +124,11 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
_invoke1<Duration>(_onBeginFrame, _onBeginFrameZone, duration);
}

/// {@template flutter.foundation.PlatformDispatcher.onDrawFrame}
/// A callback that is invoked for each frame after [onBeginFrame] has
/// completed and after the microtask queue has been drained.
///
/// This can be used to implement a second phase of frame rendering that
/// happens after any deferred work queued by the [onBeginFrame] phase.
/// {@endtemplate}
@override
ui.VoidCallback? get onDrawFrame => _onDrawFrame;
ui.VoidCallback? _onDrawFrame;
Expand Down