From b635d97674e9d06780ac1be39d0c0657a8f28ca8 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Mon, 13 Jul 2020 13:51:03 -0700 Subject: [PATCH] Add widget of the week videos to documentation (#61368) --- packages/flutter/lib/src/cupertino/action_sheet.dart | 2 ++ .../lib/src/cupertino/activity_indicator.dart | 2 ++ packages/flutter/lib/src/material/about.dart | 2 ++ .../flutter/lib/src/material/checkbox_list_tile.dart | 2 ++ packages/flutter/lib/src/material/divider.dart | 2 ++ packages/flutter/lib/src/material/drawer.dart | 2 ++ .../flutter/lib/src/material/progress_indicator.dart | 4 ++++ packages/flutter/lib/src/material/snack_bar.dart | 2 ++ .../flutter/lib/src/material/tab_controller.dart | 2 ++ packages/flutter/lib/src/material/tabs.dart | 4 ++++ .../flutter/lib/src/material/toggle_buttons.dart | 2 ++ packages/flutter/lib/src/widgets/basic.dart | 12 ++++++++++++ packages/flutter/lib/src/widgets/image.dart | 2 ++ .../lib/src/widgets/list_wheel_scroll_view.dart | 2 ++ .../lib/src/widgets/notification_listener.dart | 2 ++ packages/flutter/lib/src/widgets/transitions.dart | 2 ++ .../lib/src/widgets/tween_animation_builder.dart | 2 ++ 17 files changed, 48 insertions(+) diff --git a/packages/flutter/lib/src/cupertino/action_sheet.dart b/packages/flutter/lib/src/cupertino/action_sheet.dart index d2bc5b349a..8bc6e6436c 100644 --- a/packages/flutter/lib/src/cupertino/action_sheet.dart +++ b/packages/flutter/lib/src/cupertino/action_sheet.dart @@ -77,6 +77,8 @@ const double _kDividerThickness = 1.0; /// An iOS-style action sheet. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=U-ao8p4A82k} +/// /// An action sheet is a specific style of alert that presents the user /// with a set of two or more choices related to the current context. /// An action sheet can have a title, an additional message, and a list diff --git a/packages/flutter/lib/src/cupertino/activity_indicator.dart b/packages/flutter/lib/src/cupertino/activity_indicator.dart index 62378da87f..c09daa2fa5 100644 --- a/packages/flutter/lib/src/cupertino/activity_indicator.dart +++ b/packages/flutter/lib/src/cupertino/activity_indicator.dart @@ -20,6 +20,8 @@ const Color _kActiveTickColor = CupertinoDynamicColor.withBrightness( /// An iOS-style activity indicator that spins clockwise. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=AENVH-ZqKDQ} +/// /// See also: /// /// * diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index 63337e6be4..c42295bd34 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -313,6 +313,8 @@ const double _textVerticalSeparation = 18.0; /// /// To show an [AboutDialog], use [showAboutDialog]. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=YFCSODyFxbE} +/// /// If the application has a [Drawer], the [AboutListTile] widget can make the /// process of showing an about dialog simpler. /// diff --git a/packages/flutter/lib/src/material/checkbox_list_tile.dart b/packages/flutter/lib/src/material/checkbox_list_tile.dart index 6146663e7e..b74f210ed9 100644 --- a/packages/flutter/lib/src/material/checkbox_list_tile.dart +++ b/packages/flutter/lib/src/material/checkbox_list_tile.dart @@ -19,6 +19,8 @@ import 'theme_data.dart'; /// The entire list tile is interactive: tapping anywhere in the tile toggles /// the checkbox. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=RkSqPAn9szs} +/// /// The [value], [onChanged], [activeColor] and [checkColor] properties of this widget are /// identical to the similarly-named properties on the [Checkbox] widget. /// diff --git a/packages/flutter/lib/src/material/divider.dart b/packages/flutter/lib/src/material/divider.dart index f3b42dafab..9aaeab0d91 100644 --- a/packages/flutter/lib/src/material/divider.dart +++ b/packages/flutter/lib/src/material/divider.dart @@ -21,6 +21,8 @@ import 'theme.dart'; /// To create a divider between [ListTile] items, consider using /// [ListTile.divideTiles], which is optimized for this case. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=_liUC641Nmk} +/// /// The box's total height is controlled by [height]. The appropriate /// padding is automatically computed from the height. /// diff --git a/packages/flutter/lib/src/material/drawer.dart b/packages/flutter/lib/src/material/drawer.dart index c8a0ec69cc..1165963632 100644 --- a/packages/flutter/lib/src/material/drawer.dart +++ b/packages/flutter/lib/src/material/drawer.dart @@ -51,6 +51,8 @@ const Duration _kBaseSettleDuration = Duration(milliseconds: 246); /// A material design panel that slides in horizontally from the edge of a /// [Scaffold] to show navigation links in an application. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=WRj86iHihgY} +/// /// Drawers are typically used with the [Scaffold.drawer] property. The child of /// the drawer is usually a [ListView] whose first child is a [DrawerHeader] /// that displays status information about the current user. The remaining diff --git a/packages/flutter/lib/src/material/progress_indicator.dart b/packages/flutter/lib/src/material/progress_indicator.dart index e9bca1513f..9978fcab7c 100644 --- a/packages/flutter/lib/src/material/progress_indicator.dart +++ b/packages/flutter/lib/src/material/progress_indicator.dart @@ -206,6 +206,8 @@ class _LinearProgressIndicatorPainter extends CustomPainter { /// A material design linear progress indicator, also known as a progress bar. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=O-rhXZLtpv0} +/// /// A widget that shows progress along a line. There are two kinds of linear /// progress indicators: /// @@ -397,6 +399,8 @@ class _CircularProgressIndicatorPainter extends CustomPainter { /// A material design circular progress indicator, which spins to indicate that /// the application is busy. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=O-rhXZLtpv0} +/// /// A widget that shows progress along a circle. There are two kinds of circular /// progress indicators: /// diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index 07373d0923..6412b056ec 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -143,6 +143,8 @@ class _SnackBarActionState extends State { /// A lightweight message with an optional action which briefly displays at the /// bottom of the screen. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=zpO6n_oZWw0} +/// /// To display a snack bar, call `Scaffold.of(context).showSnackBar()`, passing /// an instance of [SnackBar] that describes the message. /// diff --git a/packages/flutter/lib/src/material/tab_controller.dart b/packages/flutter/lib/src/material/tab_controller.dart index 552ce2c6be..0d6be0a5db 100644 --- a/packages/flutter/lib/src/material/tab_controller.dart +++ b/packages/flutter/lib/src/material/tab_controller.dart @@ -316,6 +316,8 @@ class _TabControllerScope extends InheritedWidget { /// The [TabController] for descendant widgets that don't specify one /// explicitly. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=POtoEH-5l40} +/// /// [DefaultTabController] is an inherited widget that is used to share a /// [TabController] with a [TabBar] or a [TabBarView]. It's used when sharing an /// explicitly created [TabController] isn't convenient because the tab bar diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 46887ec6ad..ec0bd9c6d6 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -568,6 +568,8 @@ class _TabBarScrollController extends ScrollController { /// Typically created as the [AppBar.bottom] part of an [AppBar] and in /// conjunction with a [TabBarView]. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=POtoEH-5l40} +/// /// If a [TabController] is not provided, then a [DefaultTabController] ancestor /// must be provided instead. The tab controller's [TabController.length] must /// equal the length of the [tabs] list and the length of the @@ -1144,6 +1146,8 @@ class _TabBarState extends State { /// /// This widget is typically used in conjunction with a [TabBar]. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=POtoEH-5l40} +/// /// If a [TabController] is not provided, then there must be a [DefaultTabController] /// ancestor. /// diff --git a/packages/flutter/lib/src/material/toggle_buttons.dart b/packages/flutter/lib/src/material/toggle_buttons.dart index 0306385c82..47d819e72b 100644 --- a/packages/flutter/lib/src/material/toggle_buttons.dart +++ b/packages/flutter/lib/src/material/toggle_buttons.dart @@ -25,6 +25,8 @@ import 'toggle_buttons_theme.dart'; /// correlated by their index in the list. The length of [isSelected] has to /// match the length of the [children] list. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=kVEguaQWGAY} +/// /// ## Customizing toggle buttons /// Each toggle's behavior can be configured by the [onPressed] callback, which /// can update the [isSelected] list however it wants to. diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index a979d24304..fac6a72dfe 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -269,6 +269,8 @@ class Opacity extends SingleChildRenderObjectWidget { /// For example, [ShaderMask] can be used to gradually fade out the edge /// of a child by using a [new ui.Gradient.linear] mask. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=7sUL66pTQ7Q} +/// /// {@tool snippet} /// /// This example makes the text look like it is on fire: @@ -706,6 +708,8 @@ class ClipRRect extends SingleChildRenderObjectWidget { /// A widget that clips its child using an oval. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=vzWWDO6whIM} +/// /// By default, inscribes an axis-aligned oval into its layout dimensions and /// prevents its child from painting outside that oval, but the size and /// location of the clip oval can be customized using a custom [clipper]. @@ -775,6 +779,8 @@ class ClipOval extends SingleChildRenderObjectWidget { /// painted. The callback returns a path and the widget prevents the /// child from painting outside the path. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=oAUebVIb-7s} +/// /// Clipping to a path is expensive. Certain shapes have more /// optimized widgets: /// @@ -1576,6 +1582,8 @@ class RotatedBox extends SingleChildRenderObjectWidget { /// A widget that insets its child by the given padding. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=oD5RtLhhubg} +/// /// When passing layout constraints to its child, padding shrinks the /// constraints by the given padding, causing the child to layout at a smaller /// size. Padding then sizes itself to its child's size, inflated by the @@ -6371,6 +6379,8 @@ class RepaintBoundary extends SingleChildRenderObjectWidget { /// A widget that is invisible during hit testing. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=qV9pqHWxYgI} +/// /// When [ignoring] is true, this widget (and its subtree) is invisible /// to hit testing. It still consumes space during layout and paints its child /// as usual. It just cannot be the target of located events, because it returns @@ -7092,6 +7102,8 @@ class KeyedSubtree extends StatelessWidget { /// A platonic widget that calls a closure to obtain its child widget. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=xXNOkIuSYuA} +/// /// See also: /// /// * [StatefulBuilder], a platonic widget which also has state. diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart index 9712a5d270..1d42b0effe 100644 --- a/packages/flutter/lib/src/widgets/image.dart +++ b/packages/flutter/lib/src/widgets/image.dart @@ -233,6 +233,8 @@ typedef ImageErrorWidgetBuilder = Widget Function( /// A widget that displays an image. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=7oIAs-0G4mw} +/// /// Several constructors are provided for the various ways that an image can be /// specified: /// diff --git a/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart b/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart index 03d9a34805..bd95932ed0 100644 --- a/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart @@ -559,6 +559,8 @@ class FixedExtentScrollPhysics extends ScrollPhysics { /// This widget is similar to a [ListView] but with the restriction that all /// children must be the same size along the scrolling axis. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=dUhmWAz4C7Y} +/// /// When the list is at the zero scroll offset, the first child is aligned with /// the middle of the viewport. When the list is at the final scroll offset, /// the last child is aligned with the middle of the viewport diff --git a/packages/flutter/lib/src/widgets/notification_listener.dart b/packages/flutter/lib/src/widgets/notification_listener.dart index 8a05bae3cd..e91b34a127 100644 --- a/packages/flutter/lib/src/widgets/notification_listener.dart +++ b/packages/flutter/lib/src/widgets/notification_listener.dart @@ -88,6 +88,8 @@ abstract class Notification { /// A widget that listens for [Notification]s bubbling up the tree. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=cAnFbFoGM50} +/// /// Notifications will trigger the [onNotification] callback only if their /// [runtimeType] is a subtype of `T`. /// diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index 64c370f44e..fce932ac49 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -18,6 +18,8 @@ export 'package:flutter/rendering.dart' show RelativeRect; /// A widget that rebuilds when the given [Listenable] changes value. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=LKKgYpC-EPQ} +/// /// [AnimatedWidget] is most commonly used with [Animation] objects, which are /// [Listenable], but it can be used with any [Listenable], including /// [ChangeNotifier] and [ValueNotifier]. diff --git a/packages/flutter/lib/src/widgets/tween_animation_builder.dart b/packages/flutter/lib/src/widgets/tween_animation_builder.dart index c18e91f75e..f827fe4dd1 100644 --- a/packages/flutter/lib/src/widgets/tween_animation_builder.dart +++ b/packages/flutter/lib/src/widgets/tween_animation_builder.dart @@ -13,6 +13,8 @@ import 'value_listenable_builder.dart'; /// [Widget] builder that animates a property of a [Widget] to a target value /// whenever the target value changes. /// +/// {@youtube 560 315 https://www.youtube.com/watch?v=l9uHB8VXZOg} +/// /// The type of the animated property ([Color], [Rect], [double], etc.) is /// defined via the type of the provided [tween] (e.g. [ColorTween], /// [RectTween], [Tween], etc.).