Unverified Commit cb35c88b authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Add widget of the week video embeddings (#45362)

parent 873e33c7
...@@ -212,6 +212,8 @@ class DataCell { ...@@ -212,6 +212,8 @@ class DataCell {
/// A material design data table. /// 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 /// Displaying data in a table is expensive, because to lay out the
/// table all the data must be measured twice, once to negotiate 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 /// dimensions to use for each column, and once to actually lay out
......
...@@ -137,6 +137,8 @@ class Dialog extends StatelessWidget { ...@@ -137,6 +137,8 @@ class Dialog extends StatelessWidget {
/// of actions. The title is displayed above the content and the actions are /// of actions. The title is displayed above the content and the actions are
/// displayed below the content. /// 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 /// 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 /// display the title and the actions and let the content overflow, which is
/// rarely desired. Consider using a scrolling widget for [content], such as /// rarely desired. Consider using a scrolling widget for [content], such as
......
...@@ -165,6 +165,8 @@ enum ListTileControlAffinity { ...@@ -165,6 +165,8 @@ enum ListTileControlAffinity {
/// A single fixed-height row that typically contains some text as well as /// A single fixed-height row that typically contains some text as well as
/// a leading or trailing icon. /// 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 /// 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 /// other widgets, such as check boxes. The icons (or other widgets) for the
/// tile are defined with the [leading] and [trailing] parameters. The first /// tile are defined with the [leading] and [trailing] parameters. The first
......
...@@ -52,6 +52,8 @@ typedef ReorderCallback = void Function(int oldIndex, int newIndex); ...@@ -52,6 +52,8 @@ typedef ReorderCallback = void Function(int oldIndex, int newIndex);
/// those children that are actually visible. /// those children that are actually visible.
/// ///
/// All [children] must have a key. /// All [children] must have a key.
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=3fB1mxOsqJE}
class ReorderableListView extends StatefulWidget { class ReorderableListView extends StatefulWidget {
/// Creates a reorderable list. /// Creates a reorderable list.
......
...@@ -131,6 +131,8 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur ...@@ -131,6 +131,8 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur
/// The string might break across multiple lines or might all be displayed on /// The string might break across multiple lines or might all be displayed on
/// the same line depending on the layout constraints. /// 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 /// The [style] argument is optional. When omitted, the text will use the style
/// from the closest enclosing [DefaultTextStyle]. If the given style's /// from the closest enclosing [DefaultTextStyle]. If the given style's
/// [TextStyle.inherit] property is true (the default), the given style will /// [TextStyle.inherit] property is true (the default), the given style will
......
...@@ -66,6 +66,8 @@ typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChild ...@@ -66,6 +66,8 @@ typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChild
/// A widget that cross-fades between two given children and animates itself /// A widget that cross-fades between two given children and animates itself
/// between their sizes. /// between their sizes.
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=PGK2UUAyE54}
///
/// The animation is controlled through the [crossFadeState] parameter. /// The animation is controlled through the [crossFadeState] parameter.
/// [firstCurve] and [secondCurve] represent the opacity curves of the two /// [firstCurve] and [secondCurve] represent the opacity curves of the two
/// children. The [firstCurve] is inverted, i.e. it fades out when providing a /// children. The [firstCurve] is inverted, i.e. it fades out when providing a
......
...@@ -66,6 +66,8 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis ...@@ -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 /// A widget that by default does a cross-fade between a new widget and the
/// widget previously set on the [AnimatedSwitcher] as a child. /// 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 /// 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 /// one previous child can exist and be transitioning out while the newest one
/// is transitioning in. /// is transitioning in.
......
...@@ -2122,6 +2122,8 @@ class SizedBox extends SingleChildRenderObjectWidget { ...@@ -2122,6 +2122,8 @@ class SizedBox extends SingleChildRenderObjectWidget {
/// pixels, you could use `const BoxConstraints(minHeight: 50.0)` as the /// pixels, you could use `const BoxConstraints(minHeight: 50.0)` as the
/// [constraints]. /// [constraints].
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=o2KveVr7adg}
///
/// {@tool sample} /// {@tool sample}
/// ///
/// This snippet makes the child widget (a [Card] with some [Text]) fill the /// This snippet makes the child widget (a [Card] with some [Text]) fill the
...@@ -2269,6 +2271,8 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget { ...@@ -2269,6 +2271,8 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget {
/// For more details about the layout algorithm, see /// For more details about the layout algorithm, see
/// [RenderFractionallySizedOverflowBox]. /// [RenderFractionallySizedOverflowBox].
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=PEsY654EGZ0}
///
/// See also: /// See also:
/// ///
/// * [Align], which sizes itself based on its child's size and positions /// * [Align], which sizes itself based on its child's size and positions
...@@ -2375,6 +2379,8 @@ class FractionallySizedBox extends SingleChildRenderObjectWidget { ...@@ -2375,6 +2379,8 @@ class FractionallySizedBox extends SingleChildRenderObjectWidget {
/// parents' size, so that they behave reasonably in lists (which are /// parents' size, so that they behave reasonably in lists (which are
/// unbounded). /// unbounded).
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=uVki2CIzBTs}
///
/// See also: /// See also:
/// ///
/// * [ConstrainedBox], which applies its constraints in all cases, not just /// * [ConstrainedBox], which applies its constraints in all cases, not just
...@@ -3064,6 +3070,8 @@ class ListBody extends MultiChildRenderObjectWidget { ...@@ -3064,6 +3070,8 @@ class ListBody extends MultiChildRenderObjectWidget {
/// way, for example having some text and an image, overlaid with a gradient and /// way, for example having some text and an image, overlaid with a gradient and
/// a button attached to the bottom. /// 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_. /// Each child of a [Stack] widget is either _positioned_ or _non-positioned_.
/// Positioned children are those wrapped in a [Positioned] widget that has at /// 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 /// least one non-null property. The stack sizes itself to contain all the
...@@ -3262,6 +3270,8 @@ class Stack extends MultiChildRenderObjectWidget { ...@@ -3262,6 +3270,8 @@ class Stack extends MultiChildRenderObjectWidget {
/// ///
/// If value is null, then nothing is displayed. /// If value is null, then nothing is displayed.
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=_O0PPD1Xfbk}
///
/// See also: /// See also:
/// ///
/// * [Stack], for more details about stacks. /// * [Stack], for more details about stacks.
...@@ -4963,6 +4973,8 @@ class Flow extends MultiChildRenderObjectWidget { ...@@ -4963,6 +4973,8 @@ class Flow extends MultiChildRenderObjectWidget {
/// A paragraph of rich text. /// 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 /// The [RichText] widget displays text that uses multiple different styles. The
/// text to display is described using a tree of [TextSpan] objects, each of /// 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 /// which has an associated style that is used for that subtree. The text might
...@@ -6179,6 +6191,8 @@ class MetaData extends SingleChildRenderObjectWidget { ...@@ -6179,6 +6191,8 @@ class MetaData extends SingleChildRenderObjectWidget {
/// Used by accessibility tools, search engines, and other semantic analysis /// Used by accessibility tools, search engines, and other semantic analysis
/// software to determine the meaning of the application. /// software to determine the meaning of the application.
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=NvtMt_DtFrQ}
///
/// See also: /// See also:
/// ///
/// * [MergeSemantics], which marks a subtree as being a single node for /// * [MergeSemantics], which marks a subtree as being a single node for
......
...@@ -165,6 +165,8 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -165,6 +165,8 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// A convenience widget that combines common painting, positioning, and sizing /// A convenience widget that combines common painting, positioning, and sizing
/// widgets. /// widgets.
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=c1xLMaTUWCY}
///
/// A container first surrounds the child with [padding] (inflated by any /// A container first surrounds the child with [padding] (inflated by any
/// borders present in the [decoration]) and then applies additional /// borders present in the [decoration]) and then applies additional
/// [constraints] to the padded extent (incorporating the `width` and `height` /// [constraints] to the padded extent (incorporating the `width` and `height`
......
...@@ -32,6 +32,8 @@ typedef ScrollableWidgetBuilder = Widget Function( ...@@ -32,6 +32,8 @@ typedef ScrollableWidgetBuilder = Widget Function(
/// A container for a [Scrollable] that responds to drag gestures by resizing /// A container for a [Scrollable] that responds to drag gestures by resizing
/// the scrollable until a limit is reached, and then scrolling. /// 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 /// This widget can be dragged along the vertical axis between its
/// [minChildSize], which defaults to `0.25` and [maxChildSize], which defaults /// [minChildSize], which defaults to `0.25` and [maxChildSize], which defaults
/// to `1.0`. These sizes are percentages of the height of the parent container. /// to `1.0`. These sizes are percentages of the height of the parent container.
......
...@@ -779,6 +779,8 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState<AnimatedContainer> ...@@ -779,6 +779,8 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState<AnimatedContainer>
/// Animated version of [Padding] which automatically transitions the /// Animated version of [Padding] which automatically transitions the
/// indentation over a given duration whenever the given inset changes. /// 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] /// Here's an illustration of what using this widget looks like, using a [curve]
/// of [Curves.fastOutSlowIn]. /// of [Curves.fastOutSlowIn].
/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_padding.mp4} /// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_padding.mp4}
...@@ -942,6 +944,8 @@ class _AnimatedAlignState extends AnimatedWidgetBaseState<AnimatedAlign> { ...@@ -942,6 +944,8 @@ class _AnimatedAlignState extends AnimatedWidgetBaseState<AnimatedAlign> {
/// Animated version of [Positioned] which automatically transitions the child's /// Animated version of [Positioned] which automatically transitions the child's
/// position over a given duration whenever the given position changes. /// 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]. /// 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 /// This widget is a good choice if the _size_ of the child would end up
...@@ -1238,6 +1242,8 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat ...@@ -1238,6 +1242,8 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat
/// Animated version of [Opacity] which automatically transitions the child's /// Animated version of [Opacity] which automatically transitions the child's
/// opacity over a given duration whenever the given opacity changes. /// opacity over a given duration whenever the given opacity changes.
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=QZAvjqOqiLY}
///
/// Animating an opacity is relatively expensive because it requires painting /// Animating an opacity is relatively expensive because it requires painting
/// the child into an intermediate buffer. /// the child into an intermediate buffer.
/// ///
......
...@@ -49,6 +49,8 @@ class _PlaceholderPainter extends CustomPainter { ...@@ -49,6 +49,8 @@ class _PlaceholderPainter extends CustomPainter {
/// By default, the placeholder is sized to fit its container. If the /// By default, the placeholder is sized to fit its container. If the
/// placeholder is in an unbounded space, it will size itself according to the /// placeholder is in an unbounded space, it will size itself according to the
/// given [fallbackWidth] and [fallbackHeight]. /// given [fallbackWidth] and [fallbackHeight].
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=LPe56fezmoo}
class Placeholder extends StatelessWidget { class Placeholder extends StatelessWidget {
/// Creates a widget which draws a box. /// Creates a widget which draws a box.
const Placeholder({ const Placeholder({
......
...@@ -565,6 +565,8 @@ abstract class BoxScrollView extends ScrollView { ...@@ -565,6 +565,8 @@ abstract class BoxScrollView extends ScrollView {
/// A scrollable list of widgets arranged linearly. /// A scrollable list of widgets arranged linearly.
/// ///
/// {@youtube 560 315 https://www.youtube.com/watch?v=KJpkjHGiI5A}
///
/// [ListView] is the most commonly used scrolling widget. It displays its /// [ListView] is the most commonly used scrolling widget. It displays its
/// children one after another in the scroll direction. In the cross axis, the /// children one after another in the scroll direction. In the cross axis, the
/// children are required to fill the [ListView]. /// children are required to fill the [ListView].
......
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