From cb35c88b349ff37657218293b83e2c59464d7386 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 21 Nov 2019 22:07:03 -0800 Subject: [PATCH] Add widget of the week video embeddings (#45362) --- packages/flutter/lib/src/material/data_table.dart | 2 ++ packages/flutter/lib/src/material/dialog.dart | 2 ++ packages/flutter/lib/src/material/list_tile.dart | 2 ++ .../flutter/lib/src/material/reorderable_list.dart | 2 ++ .../flutter/lib/src/material/selectable_text.dart | 2 ++ .../lib/src/widgets/animated_cross_fade.dart | 2 ++ .../flutter/lib/src/widgets/animated_switcher.dart | 2 ++ packages/flutter/lib/src/widgets/basic.dart | 14 ++++++++++++++ packages/flutter/lib/src/widgets/container.dart | 2 ++ .../src/widgets/draggable_scrollable_sheet.dart | 2 ++ .../lib/src/widgets/implicit_animations.dart | 6 ++++++ packages/flutter/lib/src/widgets/placeholder.dart | 2 ++ packages/flutter/lib/src/widgets/scroll_view.dart | 2 ++ 13 files changed, 42 insertions(+) diff --git a/packages/flutter/lib/src/material/data_table.dart b/packages/flutter/lib/src/material/data_table.dart index cccd97b5584..4c379df1624 100644 --- a/packages/flutter/lib/src/material/data_table.dart +++ b/packages/flutter/lib/src/material/data_table.dart @@ -212,6 +212,8 @@ class DataCell { /// A material design data table. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=ktTajqbhIcY} +/// /// Displaying data in a table is expensive, because to lay out the /// table all the data must be measured twice, once to negotiate the /// dimensions to use for each column, and once to actually lay out diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index e0e202b4eea..f6551f036c9 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -137,6 +137,8 @@ class Dialog extends StatelessWidget { /// of actions. The title is displayed above the content and the actions are /// displayed below the content. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=75CsnyRXf5I} +/// /// If the content is too large to fit on the screen vertically, the dialog will /// display the title and the actions and let the content overflow, which is /// rarely desired. Consider using a scrolling widget for [content], such as diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index 2d2e6391202..ba9dd54c4e8 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -165,6 +165,8 @@ enum ListTileControlAffinity { /// A single fixed-height row that typically contains some text as well as /// a leading or trailing icon. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=l8dj0yPBvgQ} +/// /// A list tile contains one to three lines of text optionally flanked by icons or /// other widgets, such as check boxes. The icons (or other widgets) for the /// tile are defined with the [leading] and [trailing] parameters. The first diff --git a/packages/flutter/lib/src/material/reorderable_list.dart b/packages/flutter/lib/src/material/reorderable_list.dart index 7e901c4d969..2aeced5131f 100644 --- a/packages/flutter/lib/src/material/reorderable_list.dart +++ b/packages/flutter/lib/src/material/reorderable_list.dart @@ -52,6 +52,8 @@ typedef ReorderCallback = void Function(int oldIndex, int newIndex); /// those children that are actually visible. /// /// All [children] must have a key. +/// +/// {@youtube 560 315 https://www.youtube.com/watch?v=3fB1mxOsqJE} class ReorderableListView extends StatefulWidget { /// Creates a reorderable list. diff --git a/packages/flutter/lib/src/material/selectable_text.dart b/packages/flutter/lib/src/material/selectable_text.dart index a2d08ee64d3..169b3d53875 100644 --- a/packages/flutter/lib/src/material/selectable_text.dart +++ b/packages/flutter/lib/src/material/selectable_text.dart @@ -131,6 +131,8 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur /// The string might break across multiple lines or might all be displayed on /// the same line depending on the layout constraints. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=ZSU3ZXOs6hc} +/// /// The [style] argument is optional. When omitted, the text will use the style /// from the closest enclosing [DefaultTextStyle]. If the given style's /// [TextStyle.inherit] property is true (the default), the given style will diff --git a/packages/flutter/lib/src/widgets/animated_cross_fade.dart b/packages/flutter/lib/src/widgets/animated_cross_fade.dart index e5ac68afd9c..7ace4b2584d 100644 --- a/packages/flutter/lib/src/widgets/animated_cross_fade.dart +++ b/packages/flutter/lib/src/widgets/animated_cross_fade.dart @@ -66,6 +66,8 @@ typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChild /// A widget that cross-fades between two given children and animates itself /// between their sizes. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=PGK2UUAyE54} +/// /// The animation is controlled through the [crossFadeState] parameter. /// [firstCurve] and [secondCurve] represent the opacity curves of the two /// children. The [firstCurve] is inverted, i.e. it fades out when providing a diff --git a/packages/flutter/lib/src/widgets/animated_switcher.dart b/packages/flutter/lib/src/widgets/animated_switcher.dart index 338e86baa72..aa768e8afca 100644 --- a/packages/flutter/lib/src/widgets/animated_switcher.dart +++ b/packages/flutter/lib/src/widgets/animated_switcher.dart @@ -66,6 +66,8 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis /// A widget that by default does a cross-fade between a new widget and the /// widget previously set on the [AnimatedSwitcher] as a child. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=2W7POjFb88g} +/// /// If they are swapped fast enough (i.e. before [duration] elapses), more than /// one previous child can exist and be transitioning out while the newest one /// is transitioning in. diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 65b7d7a969f..eb2150db1c1 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -2122,6 +2122,8 @@ class SizedBox extends SingleChildRenderObjectWidget { /// pixels, you could use `const BoxConstraints(minHeight: 50.0)` as the /// [constraints]. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=o2KveVr7adg} +/// /// {@tool sample} /// /// This snippet makes the child widget (a [Card] with some [Text]) fill the @@ -2269,6 +2271,8 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget { /// For more details about the layout algorithm, see /// [RenderFractionallySizedOverflowBox]. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=PEsY654EGZ0} +/// /// See also: /// /// * [Align], which sizes itself based on its child's size and positions @@ -2375,6 +2379,8 @@ class FractionallySizedBox extends SingleChildRenderObjectWidget { /// parents' size, so that they behave reasonably in lists (which are /// unbounded). /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=uVki2CIzBTs} +/// /// See also: /// /// * [ConstrainedBox], which applies its constraints in all cases, not just @@ -3064,6 +3070,8 @@ class ListBody extends MultiChildRenderObjectWidget { /// way, for example having some text and an image, overlaid with a gradient and /// a button attached to the bottom. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=liEGSeD3Zt8} +/// /// Each child of a [Stack] widget is either _positioned_ or _non-positioned_. /// Positioned children are those wrapped in a [Positioned] widget that has at /// least one non-null property. The stack sizes itself to contain all the @@ -3262,6 +3270,8 @@ class Stack extends MultiChildRenderObjectWidget { /// /// If value is null, then nothing is displayed. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=_O0PPD1Xfbk} +/// /// See also: /// /// * [Stack], for more details about stacks. @@ -4963,6 +4973,8 @@ class Flow extends MultiChildRenderObjectWidget { /// A paragraph of rich text. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=rykDVh-QFfw} +/// /// The [RichText] widget displays text that uses multiple different styles. The /// text to display is described using a tree of [TextSpan] objects, each of /// which has an associated style that is used for that subtree. The text might @@ -6179,6 +6191,8 @@ class MetaData extends SingleChildRenderObjectWidget { /// Used by accessibility tools, search engines, and other semantic analysis /// software to determine the meaning of the application. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=NvtMt_DtFrQ} +/// /// See also: /// /// * [MergeSemantics], which marks a subtree as being a single node for diff --git a/packages/flutter/lib/src/widgets/container.dart b/packages/flutter/lib/src/widgets/container.dart index b9b892ba477..f448c53c028 100644 --- a/packages/flutter/lib/src/widgets/container.dart +++ b/packages/flutter/lib/src/widgets/container.dart @@ -165,6 +165,8 @@ class DecoratedBox extends SingleChildRenderObjectWidget { /// A convenience widget that combines common painting, positioning, and sizing /// widgets. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=c1xLMaTUWCY} +/// /// A container first surrounds the child with [padding] (inflated by any /// borders present in the [decoration]) and then applies additional /// [constraints] to the padded extent (incorporating the `width` and `height` diff --git a/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart b/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart index 76de90a4f9d..bea9279524d 100644 --- a/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart +++ b/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart @@ -32,6 +32,8 @@ typedef ScrollableWidgetBuilder = Widget Function( /// A container for a [Scrollable] that responds to drag gestures by resizing /// the scrollable until a limit is reached, and then scrolling. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=Hgw819mL_78} +/// /// This widget can be dragged along the vertical axis between its /// [minChildSize], which defaults to `0.25` and [maxChildSize], which defaults /// to `1.0`. These sizes are percentages of the height of the parent container. diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 099eef57c09..6e755ffd226 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -779,6 +779,8 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState /// Animated version of [Padding] which automatically transitions the /// indentation over a given duration whenever the given inset changes. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=PY2m0fhGNz4} +/// /// Here's an illustration of what using this widget looks like, using a [curve] /// of [Curves.fastOutSlowIn]. /// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_padding.mp4} @@ -942,6 +944,8 @@ class _AnimatedAlignState extends AnimatedWidgetBaseState { /// Animated version of [Positioned] which automatically transitions the child's /// position over a given duration whenever the given position changes. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=hC3s2YdtWt8} +/// /// Only works if it's the child of a [Stack]. /// /// This widget is a good choice if the _size_ of the child would end up @@ -1238,6 +1242,8 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState