From 30d4736900c3ae49770e5a4b4686200878941c1c Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Wed, 3 May 2017 09:13:57 -0700 Subject: [PATCH] Random dartdoc fixes (#9745) --- .../src/animation/animation_controller.dart | 6 +++--- packages/flutter/lib/src/animation/curves.dart | 18 ++++++++++++++---- packages/flutter/lib/src/cupertino/slider.dart | 2 -- .../flutter/lib/src/foundation/assertions.dart | 2 +- packages/flutter/lib/src/material/app_bar.dart | 2 -- .../flutter/lib/src/material/checkbox.dart | 6 +++--- .../flutter/lib/src/material/date_picker.dart | 9 +++++---- .../lib/src/material/flexible_space_bar.dart | 2 +- packages/flutter/lib/src/material/radio.dart | 5 ++--- packages/flutter/lib/src/material/slider.dart | 5 ++--- packages/flutter/lib/src/material/switch.dart | 6 +++--- .../flutter/lib/src/material/typography.dart | 8 +++++--- .../flutter/lib/src/painting/decoration.dart | 2 +- packages/flutter/lib/src/rendering/box.dart | 5 +++-- .../flutter/lib/src/rendering/semantics.dart | 4 ++-- .../lib/src/rendering/viewport_offset.dart | 2 +- .../flutter/lib/src/widgets/animated_list.dart | 14 +++++++------- .../lib/src/widgets/implicit_animations.dart | 2 +- .../flutter/lib/src/widgets/transitions.dart | 2 +- packages/flutter_test/lib/src/finders.dart | 4 ++-- 20 files changed, 57 insertions(+), 49 deletions(-) diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart index 6977308052..2e53a3eca8 100644 --- a/packages/flutter/lib/src/animation/animation_controller.dart +++ b/packages/flutter/lib/src/animation/animation_controller.dart @@ -165,9 +165,9 @@ class AnimationController extends Animation /// identifying animation controller instances in debug output. final String debugLabel; - /// Returns an [Animated] for this animation controller, - /// so that a pointer to this object can be passed around without - /// allowing users of that pointer to mutate the AnimationController state. + /// Returns an [Animation] for this animation controller, so that a + /// pointer to this object can be passed around without allowing users of that + /// pointer to mutate the [AnimationController] state. Animation get view => this; /// The length of time this animation should last. diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index 7251faf952..d8cdf2382e 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -73,20 +73,30 @@ class SawTooth extends Curve { } } -/// A curve that is 0.0 until [start], then curved from 0.0 to 1.0 at [end], then 1.0. +/// A curve that is 0.0 until [begin], then curved (according to [curve] from +/// 0.0 to 1.0 at [end], then 1.0. +/// +/// An [Interval] can be used to delay an animation. For example, a six second +/// animation that uses an [Interval] with its [begin] set to 0.5 and its [end] +/// set to 1.0 will essentially become a three-second animation that starts +/// three seconds later. class Interval extends Curve { /// Creates an interval curve. /// - /// The [start] and [end] arguments must not be null. + /// The arguments must not be null. const Interval(this.begin, this.end, { this.curve: Curves.linear }); - /// The smallest value for which this interval is 0.0. + /// The largest value for which this interval is 0.0. + /// + /// From t=0.0 to t=`begin`, the interval's value is 0.0. final double begin; /// The smallest value for which this interval is 1.0. + /// + /// From t=`end` to t=1.0, the interval's value is 1.0. final double end; - /// The curve to apply between [start] and [end]. + /// The curve to apply between [begin] and [end]. final Curve curve; @override diff --git a/packages/flutter/lib/src/cupertino/slider.dart b/packages/flutter/lib/src/cupertino/slider.dart index 7cf8bb2dc2..94428b0922 100644 --- a/packages/flutter/lib/src/cupertino/slider.dart +++ b/packages/flutter/lib/src/cupertino/slider.dart @@ -100,8 +100,6 @@ class CupertinoSlider extends StatefulWidget { /// The number of discrete divisions. /// - /// Typically used with [label] to show the current discrete value. - /// /// If null, the slider is continuous. final int divisions; diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index ca1601fb2f..ad62acd946 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.dart @@ -5,7 +5,7 @@ import 'basic_types.dart'; import 'print.dart'; -/// Signature for [FlutterError.onException] handler. +/// Signature for [FlutterError.onError] handler. typedef void FlutterExceptionHandler(FlutterErrorDetails details); /// Signature for [FlutterErrorDetails.informationCollector] callback diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index 5f37d00467..3595ae4bd7 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -838,8 +838,6 @@ class SliverAppBar extends StatefulWidget { /// /// This does not include the status bar height (which will be automatically /// included if [primary] is true). - /// - /// See also [AppBar.getExpandedHeightFor]. final double expandedHeight; /// Whether the app bar should become visible as soon as the user scrolls diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart index cfdd7c309f..1d6c04e454 100644 --- a/packages/flutter/lib/src/material/checkbox.dart +++ b/packages/flutter/lib/src/material/checkbox.dart @@ -25,9 +25,9 @@ import 'toggleable.dart'; /// /// See also: /// -/// * [Radio] -/// * [Switch] -/// * [Slider] +/// * [Switch], another widget with similar semantics. +/// * [Radio], for selecting among a set of explicit values. +/// * [Slider], for selecting a value in a range. /// * /// * class Checkbox extends StatefulWidget { diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index 5754dfd243..5b94744439 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -172,7 +172,7 @@ const _DayPickerGridDelegate _kDayPickerGridDelegate = const _DayPickerGridDeleg class DayPicker extends StatelessWidget { /// Creates a day picker. /// - /// Rarely used directly. Instead, typically used as part of a [DatePicker]. + /// Rarely used directly. Instead, typically used as part of a [MonthPicker]. DayPicker({ Key key, @required this.selectedDate, @@ -323,7 +323,8 @@ class DayPicker extends StatelessWidget { class MonthPicker extends StatefulWidget { /// Creates a month picker. /// - /// Rarely used directly. Instead, typically used as part of a [DatePicker]. + /// Rarely used directly. Instead, typically used as part of the dialog shown + /// by [showDatePicker]. MonthPicker({ Key key, @required this.selectedDate, @@ -511,7 +512,8 @@ class YearPicker extends StatefulWidget { /// The [selectedDate] and [onChanged] arguments must not be null. The /// [lastDate] must be after the [firstDate]. /// - /// Rarely used directly. Instead, typically used as part of a [DatePicker]. + /// Rarely used directly. Instead, typically used as part of the dialog shown + /// by [showDatePicker]. YearPicker({ Key key, @required this.selectedDate, @@ -687,7 +689,6 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ], ), ); - return new Dialog( child: new OrientationBuilder( builder: (BuildContext context, Orientation orientation) { diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart index 9ca9d77412..e57afa32de 100644 --- a/packages/flutter/lib/src/material/flexible_space_bar.dart +++ b/packages/flutter/lib/src/material/flexible_space_bar.dart @@ -44,7 +44,7 @@ class FlexibleSpaceBar extends StatefulWidget { /// Shown behind the [title] when expanded. /// - /// Typically an [AssetImage] widget with [AssetImage.fit] set to [BoxFit.cover]. + /// Typically an [Image] widget with [Image.fit] set to [BoxFit.cover]. final Widget background; /// Whether the title should be centered. diff --git a/packages/flutter/lib/src/material/radio.dart b/packages/flutter/lib/src/material/radio.dart index 55e7ce37ac..b8f88339bf 100644 --- a/packages/flutter/lib/src/material/radio.dart +++ b/packages/flutter/lib/src/material/radio.dart @@ -31,9 +31,8 @@ const double _kInnerRadius = 5.0; /// /// See also: /// -/// * [CheckBox] -/// * [Slider] -/// * [Switch] +/// * [Slider], for selecting a value in a range. +/// * [Checkbox] and [Switch], for toggling a particular value on or off. /// * class Radio extends StatefulWidget { /// Creates a material design radio button. diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index 64fec7f4fc..28e1cefa81 100644 --- a/packages/flutter/lib/src/material/slider.dart +++ b/packages/flutter/lib/src/material/slider.dart @@ -35,9 +35,8 @@ import 'typography.dart'; /// /// See also: /// -/// * [CheckBox] -/// * [Radio] -/// * [Switch] +/// * [Radio], for selecting among a set of explicit values. +/// * [Checkbox] and [Switch], for toggling a particular value on or off. /// * class Slider extends StatefulWidget { /// Creates a material design slider. diff --git a/packages/flutter/lib/src/material/switch.dart b/packages/flutter/lib/src/material/switch.dart index a09b76ed9a..9bbd7312c9 100644 --- a/packages/flutter/lib/src/material/switch.dart +++ b/packages/flutter/lib/src/material/switch.dart @@ -28,9 +28,9 @@ import 'toggleable.dart'; /// /// See also: /// -/// * [CheckBox] -/// * [Radio] -/// * [Slider] +/// * [Checkbox], another widget with similar semantics. +/// * [Radio], for selecting among a set of explicit values. +/// * [Slider], for selecting a value in a range. /// * class Switch extends StatefulWidget { /// Creates a material design switch. diff --git a/packages/flutter/lib/src/material/typography.dart b/packages/flutter/lib/src/material/typography.dart index 9ea49c36c6..92e4bcad0f 100644 --- a/packages/flutter/lib/src/material/typography.dart +++ b/packages/flutter/lib/src/material/typography.dart @@ -111,7 +111,7 @@ class TextTheme { /// Very, very large text. /// - /// Used for the date in [DatePicker]. + /// Used for the date in the dialog shown by [showDatePicker]. final TextStyle display3; /// Very large text. @@ -120,10 +120,12 @@ class TextTheme { /// Large text. final TextStyle display1; - /// Used for large text in dialogs (e.g., the month and year in [DatePicker]). + /// Used for large text in dialogs (e.g., the month and year in the dialog + /// shown by [showDatePicker]). final TextStyle headline; - /// Used for the primary text in app bars and dialogs (e.g., [AppBar.title] and [Dialog.title]). + /// Used for the primary text in app bars and dialogs (e.g., [AppBar.title] + /// and [AlertDialog.title]). final TextStyle title; /// Used for the primary text in lists (e.g., [ListTile.title]). diff --git a/packages/flutter/lib/src/painting/decoration.dart b/packages/flutter/lib/src/painting/decoration.dart index 95d55a0717..9507984b09 100644 --- a/packages/flutter/lib/src/painting/decoration.dart +++ b/packages/flutter/lib/src/painting/decoration.dart @@ -78,7 +78,7 @@ abstract class Decoration { /// /// The `onChanged` argument configures [BoxPainter.onChanged]. It can be /// omitted if there is no chance that the painter will change (for example, - /// if it is a [BoxDecoration] with definitely no [BackgroundImage]). + /// if it is a [BoxDecoration] with definitely no [DecorationImage]). BoxPainter createBoxPainter([VoidCallback onChanged]); /// Returns a string representation of this object. diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 703276a138..40de684a7d 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -22,7 +22,7 @@ class _DebugSize extends Size { /// Immutable layout constraints for [RenderBox] layout. /// -/// A size respects a BoxConstraints if, and only if, all of the following +/// A size respects a [BoxConstraints] if, and only if, all of the following /// relations hold: /// /// * `minWidth <= size.width <= maxWidth` @@ -343,7 +343,8 @@ class BoxConstraints extends Constraints { /// Linearly interpolate between two BoxConstraints. /// - /// If either is null, this function interpolates from [BoxConstraints.zero]. + /// If either is null, this function interpolates from a [BoxConstraints] + /// object whose fields are all set to 0.0. static BoxConstraints lerp(BoxConstraints a, BoxConstraints b, double t) { if (a == null && b == null) return null; diff --git a/packages/flutter/lib/src/rendering/semantics.dart b/packages/flutter/lib/src/rendering/semantics.dart index 72d7fa5acb..4b51994568 100644 --- a/packages/flutter/lib/src/rendering/semantics.dart +++ b/packages/flutter/lib/src/rendering/semantics.dart @@ -18,8 +18,8 @@ export 'dart:ui' show SemanticsAction; /// being tapped, etc. /// /// These handlers will only be called if the relevant flag is set -/// (e.g. [handleSemanticTap]() will only be called if -/// [SemanticsNode.canBeTapped] is true, [handleSemanticScrollDown]() will only +/// (e.g. [handleSemanticTap] will only be called if +/// [SemanticsNode.canBeTapped] is true, [handleSemanticScrollDown] will only /// be called if [SemanticsNode.canBeScrolledVertically] is true, etc). abstract class SemanticsActionHandler { // ignore: one_member_abstracts /// Called when the object implementing this interface receives a diff --git a/packages/flutter/lib/src/rendering/viewport_offset.dart b/packages/flutter/lib/src/rendering/viewport_offset.dart index c7446e055c..a7d805c46d 100644 --- a/packages/flutter/lib/src/rendering/viewport_offset.dart +++ b/packages/flutter/lib/src/rendering/viewport_offset.dart @@ -34,7 +34,7 @@ enum ScrollDirection { /// Returns the opposite of the given [ScrollDirection]. /// -/// Specifically, returns [AxisDirection.reverse] for [AxisDirection.forward] +/// Specifically, returns [ScrollDirection.reverse] for [ScrollDirection.forward] /// (and vice versa) and returns [ScrollDirection.idle] for /// [ScrollDirection.idle]. ScrollDirection flipScrollDirection(ScrollDirection direction) { diff --git a/packages/flutter/lib/src/widgets/animated_list.dart b/packages/flutter/lib/src/widgets/animated_list.dart index c6bef72885..cabdae43a4 100644 --- a/packages/flutter/lib/src/widgets/animated_list.dart +++ b/packages/flutter/lib/src/widgets/animated_list.dart @@ -17,7 +17,7 @@ import 'ticker_provider.dart'; /// Signature for the builder callback used by [AnimatedList]. typedef Widget AnimatedListItemBuilder(BuildContext context, int index, Animation animation); -/// Signature for the builder callback used by [AnimatedList.remove]. +/// Signature for the builder callback used by [AnimatedListState.removeItem]. typedef Widget AnimatedListRemovedItemBuilder(BuildContext context, Animation animation); // The default insert/remove animation duration. @@ -67,13 +67,13 @@ class AnimatedList extends StatefulWidget { /// List items are only built when they're scrolled into view. /// /// The [AnimatedListItemBuilder] index parameter indicates the item's - /// posiition in the list. The value of the index parameter will be between 0 and - /// [initialItemCount] plus the total number of items that have been inserted - /// with [AnimatedListState.insertItem] and less the total number of items - /// that have been removed with [AnimatedList.removeItem]. + /// posiition in the list. The value of the index parameter will be between 0 + /// and [initialItemCount] plus the total number of items that have been + /// inserted with [AnimatedListState.insertItem] and less the total number of + /// items that have been removed with [AnimatedListState.removeItem]. /// - /// Implementations of this callback should assume that [AnimatedList.removeItem] - /// removes an item immediately. + /// Implementations of this callback should assume that + /// [AnimatedListState.removeItem] removes an item immediately. final AnimatedListItemBuilder itemBuilder; /// The number of items the list will start with. diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 0187a39b64..24b53269b5 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -11,7 +11,7 @@ import 'framework.dart'; import 'text.dart'; import 'ticker_provider.dart'; -/// An interpolation between two [BoxConstraint]s. +/// An interpolation between two [BoxConstraints]. class BoxConstraintsTween extends Tween { /// Creates a box constraints tween. /// diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index 3c59e294aa..2ffe97c148 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -397,7 +397,7 @@ class RelativePositionedTransition extends AnimatedWidget { /// * [AnimatedContainer], a more full-featured container that also animates on /// decoration using an internal animation. class DecoratedBoxTransition extends AnimatedWidget { - /// Creates an animated [DecorationBox] whose [Decoration] animation updates + /// Creates an animated [DecoratedBox] whose [Decoration] animation updates /// the widget. /// /// The [decoration] and [position] cannot be null. diff --git a/packages/flutter_test/lib/src/finders.dart b/packages/flutter_test/lib/src/finders.dart index c9e0215d15..90a136b656 100644 --- a/packages/flutter_test/lib/src/finders.dart +++ b/packages/flutter_test/lib/src/finders.dart @@ -7,10 +7,10 @@ import 'package:meta/meta.dart'; import 'all_elements.dart'; -/// Signature for [CommonFinders.byPredicate]. +/// Signature for [CommonFinders.byWidgetPredicate]. typedef bool WidgetPredicate(Widget widget); -/// Signature for [CommonFinders.byElement]. +/// Signature for [CommonFinders.byElementPredicate]. typedef bool ElementPredicate(Element element); /// Some frequently used widget [Finder]s.