diff --git a/dev/docs/assets/overrides.css b/dev/docs/assets/overrides.css
index 19cd74ec98..74b249f526 100644
--- a/dev/docs/assets/overrides.css
+++ b/dev/docs/assets/overrides.css
@@ -97,6 +97,10 @@ code {
padding-right: 0;
}
+.markdown.desc {
+ max-width: inherit;
+}
+
#search-box {
color: #555;
background-color: #fff;
diff --git a/dev/docs/lib/opensearch.xml b/dev/docs/lib/opensearch.xml
index 888ab40d3b..7a945ab67c 100644
--- a/dev/docs/lib/opensearch.xml
+++ b/dev/docs/lib/opensearch.xml
@@ -3,8 +3,10 @@
Welcome to the Flutter API reference documentation search.
-Flutter is Google’s mobile UI framework for crafting high-quality native interfaces on iOS and Android in record time.
-Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.
+Flutter is Google's SDK for crafting beautiful, fast user experiences for
+mobile, web and desktop from a single codebase. Flutter works with existing
+code, is used by developers and organizations around the world, and is free and
+open source.
The API reference herein covers all libraries that are exported by the Flutter SDK.
diff --git a/dev/snippets/config/skeletons/dartpad-sample.html b/dev/snippets/config/skeletons/dartpad-sample.html
index d47dffe5d5..2f44285ab6 100644
--- a/dev/snippets/config/skeletons/dartpad-sample.html
+++ b/dev/snippets/config/skeletons/dartpad-sample.html
@@ -22,7 +22,11 @@
+ {{description}}
+
To create a local project with this code sample, run:
+ flutter create --sample={{id}} mysample
+
{{description}}
diff --git a/dev/snippets/config/skeletons/sample.html b/dev/snippets/config/skeletons/sample.html
index 56b648cc03..92dd25aa83 100644
--- a/dev/snippets/config/skeletons/sample.html
+++ b/dev/snippets/config/skeletons/sample.html
@@ -28,7 +28,7 @@
-
To create a sample project with this code snippet, run:
+
To create a local project with this code sample, run:
flutter create --sample={{id}} mysample
diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart
index 707ee10de3..4cf28138ac 100644
--- a/packages/flutter/lib/src/animation/curves.dart
+++ b/packages/flutter/lib/src/animation/curves.dart
@@ -318,7 +318,7 @@ class Cubic extends Curve {
/// part of the curve, or hardly at all in another part of the curve, depending
/// on the definition of the curve.
///
-/// {@tool sample --template=stateless_widget_material}
+/// {@tool dartpad --template=stateless_widget_material}
/// This example shows how to use a [Curve2D] to modify the position of a widget
/// so that it can follow an arbitrary path.
///
diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart
index 10d13ff77c..c794090206 100644
--- a/packages/flutter/lib/src/material/about.dart
+++ b/packages/flutter/lib/src/material/about.dart
@@ -33,7 +33,7 @@ import 'theme.dart';
///
/// If your application does not have a [Drawer], you should provide an
/// affordance to call [showAboutDialog] or (at least) [showLicensePage].
-/// {@tool sample --template=stateless_widget_material}
+/// {@tool dartpad --template=stateless_widget_material}
///
/// This sample shows two ways to open [AboutDialog]. The first one
/// uses an [AboutListTile], and the second uses the [showAboutDialog] function.
diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart
index d6bfd58f6d..b767923450 100644
--- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart
+++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart
@@ -62,7 +62,7 @@ enum BottomNavigationBarType {
/// case it's assumed that each item will have a different background color
/// and that background color will contrast well with white.
///
-/// {@tool sample --template=stateful_widget_material}
+/// {@tool dartpad --template=stateful_widget_material}
/// This example shows a [BottomNavigationBar] as it is used within a [Scaffold]
/// widget. The [BottomNavigationBar] has three [BottomNavigationBarItem]
/// widgets and the [currentIndex] is set to index 0. The selected item is
diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart
index 0ecb4955b8..53eafd3362 100644
--- a/packages/flutter/lib/src/material/bottom_sheet.dart
+++ b/packages/flutter/lib/src/material/bottom_sheet.dart
@@ -455,9 +455,7 @@ class _ModalBottomSheetRoute
extends PopupRoute {
/// Returns a `Future` that resolves to the value (if any) that was passed to
/// [Navigator.pop] when the modal bottom sheet was closed.
///
-/// {@animation 350 622 https://flutter.github.io/assets-for-api-docs/assets/material/show_modal_bottom_sheet.mp4}
-///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This example demonstrates how to use `showModalBottomSheet` to display a
/// bottom sheet that obscures the content behind it when a user taps a button.
diff --git a/packages/flutter/lib/src/material/card.dart b/packages/flutter/lib/src/material/card.dart
index 785db00eb1..0a8e285690 100644
--- a/packages/flutter/lib/src/material/card.dart
+++ b/packages/flutter/lib/src/material/card.dart
@@ -19,7 +19,7 @@ import 'theme.dart';
/// some text describing a musical, and the other with buttons for buying
/// tickets or listening to the show.](https://flutter.github.io/assets-for-api-docs/assets/material/card.png)
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows creation of a [Card] widget that shows album information
/// and two actions.
@@ -59,7 +59,7 @@ import 'theme.dart';
/// Sometimes the primary action area of a card is the card itself. Cards can be
/// one large touch target that shows a detail screen when tapped.
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows creation of a [Card] widget that can be tapped. When
/// tapped this [Card]'s [InkWell] displays an "ink splash" that fills the
diff --git a/packages/flutter/lib/src/material/checkbox_list_tile.dart b/packages/flutter/lib/src/material/checkbox_list_tile.dart
index d1e21c471e..e684cfc182 100644
--- a/packages/flutter/lib/src/material/checkbox_list_tile.dart
+++ b/packages/flutter/lib/src/material/checkbox_list_tile.dart
@@ -37,7 +37,7 @@ import 'theme_data.dart';
/// To show the [CheckboxListTile] as disabled, pass null as the [onChanged]
/// callback.
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// 
///
@@ -166,7 +166,7 @@ import 'theme_data.dart';
/// combining [Checkbox] with other widgets, such as [Text], [Padding] and
/// [InkWell].
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// 
///
diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart
index 6e5db33da8..022c2d47d3 100644
--- a/packages/flutter/lib/src/material/chip.dart
+++ b/packages/flutter/lib/src/material/chip.dart
@@ -192,7 +192,7 @@ abstract class DeletableChipAttributes {
/// that the user tapped the delete button. In order to delete the chip, you
/// have to do something similar to the following sample:
///
- /// {@tool sample --template=stateful_widget_scaffold_center}
+ /// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// This sample shows how to use [onDeleted] to remove an entry when the
/// delete button is tapped.
diff --git a/packages/flutter/lib/src/material/data_table.dart b/packages/flutter/lib/src/material/data_table.dart
index 8451aeb294..b230a01175 100644
--- a/packages/flutter/lib/src/material/data_table.dart
+++ b/packages/flutter/lib/src/material/data_table.dart
@@ -225,7 +225,7 @@ class DataCell {
/// [PaginatedDataTable] which automatically splits the data into
/// multiple pages.
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows how to display a [DataTable] with three columns: name, age, and
/// role. The columns are defined by three [DataColumn] objects. The table
diff --git a/packages/flutter/lib/src/material/divider.dart b/packages/flutter/lib/src/material/divider.dart
index 3879e29436..edfb5665ff 100644
--- a/packages/flutter/lib/src/material/divider.dart
+++ b/packages/flutter/lib/src/material/divider.dart
@@ -22,7 +22,7 @@ import 'theme.dart';
/// The box's total height is controlled by [height]. The appropriate
/// padding is automatically computed from the height.
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows how to display a Divider between an orange and blue box
/// inside a column. The Divider is 20 logical pixels in height and contains a
diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart
index d6675efbb5..8e94a40f39 100644
--- a/packages/flutter/lib/src/material/dropdown.dart
+++ b/packages/flutter/lib/src/material/dropdown.dart
@@ -707,7 +707,7 @@ class DropdownButtonHideUnderline extends InheritedWidget {
/// dropdown's value. It should also call [State.setState] to rebuild the
/// dropdown with the new value.
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// This sample shows a `DropdownButton` with a large arrow icon,
/// purple text style, and bold purple underline, whose value is one of "One",
@@ -865,7 +865,7 @@ class DropdownButton extends StatefulWidget {
/// from the list corresponds to the [DropdownMenuItem] of the same index
/// in [items].
///
- /// {@tool sample --template=stateful_widget_scaffold}
+ /// {@tool dartpad --template=stateful_widget_scaffold}
///
/// This sample shows a `DropdownButton` with a button with [Text] that
/// corresponds to but is unique from [DropdownMenuItem].
@@ -916,7 +916,7 @@ class DropdownButton extends StatefulWidget {
/// To use a separate text style for selected item when it's displayed within
/// the dropdown button,, consider using [selectedItemBuilder].
///
- /// {@tool sample --template=stateful_widget_scaffold}
+ /// {@tool dartpad --template=stateful_widget_scaffold}
///
/// This sample shows a `DropdownButton` with a dropdown button text style
/// that is different than its menu items.
diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart
index 616aa69f7d..0e57926218 100644
--- a/packages/flutter/lib/src/material/expansion_panel.dart
+++ b/packages/flutter/lib/src/material/expansion_panel.dart
@@ -140,7 +140,7 @@ class ExpansionPanelRadio extends ExpansionPanel {
/// Note that [expansionCallback] behaves differently for [ExpansionPanelList]
/// and [ExpansionPanelList.radio].
///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
///
/// Here is a simple example of how to implement ExpansionPanelList.
///
@@ -242,7 +242,7 @@ class ExpansionPanelList extends StatefulWidget {
/// arguments must not be null. The [children] objects must be instances
/// of [ExpansionPanelRadio].
///
- /// {@tool sample --template=stateful_widget_scaffold}
+ /// {@tool dartpad --template=stateful_widget_scaffold}
///
/// Here is a simple example of how to implement ExpansionPanelList.radio.
///
diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart
index dfaa9f4efc..f3cd9264ff 100644
--- a/packages/flutter/lib/src/material/flexible_space_bar.dart
+++ b/packages/flutter/lib/src/material/flexible_space_bar.dart
@@ -50,7 +50,7 @@ enum StretchMode {
/// [FlexibleSpaceBar.createSettings], to convey sizing information down to the
/// [FlexibleSpaceBar].
///
-/// {@tool sample --template=freeform}
+/// {@tool dartpad --template=freeform}
/// This sample application demonstrates the different features of the
/// [FlexibleSpaceBar] when used in a [SliverAppBar]. This app bar is configured
/// to stretch into the overscroll space, and uses the
diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart
index c0522d7185..32b6e3c584 100644
--- a/packages/flutter/lib/src/material/floating_action_button.dart
+++ b/packages/flutter/lib/src/material/floating_action_button.dart
@@ -58,7 +58,7 @@ class _DefaultHeroTag {
/// disabled. Consider changing the [backgroundColor] if disabling the floating
/// action button.
///
-/// {@tool sample --template=stateless_widget_material}
+/// {@tool dartpad --template=stateless_widget_material}
/// This example shows how to display a [FloatingActionButton] in a
/// [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon].
///
@@ -85,7 +85,7 @@ class _DefaultHeroTag {
/// ```
/// {@end-tool}
///
-/// {@tool sample --template=stateless_widget_material}
+/// {@tool dartpad --template=stateless_widget_material}
/// This example shows how to make an extended [FloatingActionButton] in a
/// [Scaffold], with a pink [backgroundColor], a thumbs up [Icon] and a
/// [Text] label that reads "Approve".
diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart
index 2d510da0a4..daf666d58d 100644
--- a/packages/flutter/lib/src/material/icon_button.dart
+++ b/packages/flutter/lib/src/material/icon_button.dart
@@ -39,7 +39,7 @@ const double _kMinButtonSize = kMinInteractiveDimension;
/// requirements in the Material Design specification. The [alignment] controls
/// how the icon itself is positioned within the hit region.
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// This sample shows an `IconButton` that uses the Material icon "volume_up" to
/// increase the volume.
@@ -83,7 +83,7 @@ const double _kMinButtonSize = kMinInteractiveDimension;
/// the underlying [Material] along with the splash and highlight
/// [InkResponse] contributed by descendant widgets.
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// In this sample the icon button's background color is defined with an [Ink]
/// widget whose child is an [IconButton]. The icon button's filled background
diff --git a/packages/flutter/lib/src/material/ink_well.dart b/packages/flutter/lib/src/material/ink_well.dart
index f5c227da47..3ec8a6d759 100644
--- a/packages/flutter/lib/src/material/ink_well.dart
+++ b/packages/flutter/lib/src/material/ink_well.dart
@@ -921,7 +921,7 @@ class _InkResponseState extends State with AutomaticKe
///
/// An example of this situation is as follows:
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// Tap the container to cause it to grow. Then, tap it again and hold before
/// the widget reaches its maximum size to observe the clipped ink splash.
diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart
index b77267ffa4..fd32717360 100644
--- a/packages/flutter/lib/src/material/input_decorator.dart
+++ b/packages/flutter/lib/src/material/input_decorator.dart
@@ -2329,7 +2329,7 @@ class _InputDecoratorState extends State with TickerProviderStat
/// to describe their decoration. (In fact, this class is merely the
/// configuration of an [InputDecorator], which does all the heavy lifting.)
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows how to style a `TextField` using an `InputDecorator`. The
/// TextField displays a "send message" icon to the left of the input area,
@@ -2354,7 +2354,7 @@ class _InputDecoratorState extends State with TickerProviderStat
/// ```
/// {@end-tool}
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows how to style a "collapsed" `TextField` using an
/// `InputDecorator`. The collapsed `TextField` surrounds the hint text and
@@ -2374,7 +2374,7 @@ class _InputDecoratorState extends State with TickerProviderStat
/// ```
/// {@end-tool}
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows how to create a `TextField` with hint text, a red border
/// on all sides, and an error message. To display a red border and error
@@ -2395,7 +2395,7 @@ class _InputDecoratorState extends State with TickerProviderStat
/// ```
/// {@end-tool}
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows how to style a `TextField` with a round border and
/// additional text before and after the input area. It displays "Prefix" before
diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart
index 8f05df4363..a413996ca6 100644
--- a/packages/flutter/lib/src/material/list_tile.dart
+++ b/packages/flutter/lib/src/material/list_tile.dart
@@ -317,7 +317,7 @@ enum ListTileControlAffinity {
/// you're looking for, it's easy to create custom list items with a
/// combination of other widgets, such as [Row]s and [Column]s.
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// Here is an example of a custom list item that resembles a Youtube related
/// video list item created with [Expanded] and [Container] widgets.
@@ -438,7 +438,7 @@ enum ListTileControlAffinity {
/// ```
/// {@end-tool}
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// Here is an example of an article list item with multiline titles and
/// subtitles. It utilizes [Row]s and [Column]s, as well as [Expanded] and
@@ -469,7 +469,7 @@ enum ListTileControlAffinity {
/// crossAxisAlignment: CrossAxisAlignment.start,
/// children: [
/// Expanded(
-/// flex: 2,
+/// flex: 1,
/// child: Column(
/// crossAxisAlignment: CrossAxisAlignment.start,
/// children: [
@@ -508,7 +508,7 @@ enum ListTileControlAffinity {
/// ),
/// ),
/// Text(
-/// '$publishDate · $readDuration ★',
+/// '$publishDate - $readDuration',
/// style: const TextStyle(
/// fontSize: 12.0,
/// color: Colors.black54,
diff --git a/packages/flutter/lib/src/material/radio.dart b/packages/flutter/lib/src/material/radio.dart
index 64845d0737..5ebd28e0f3 100644
--- a/packages/flutter/lib/src/material/radio.dart
+++ b/packages/flutter/lib/src/material/radio.dart
@@ -29,7 +29,7 @@ const double _kInnerRadius = 4.5;
/// will respond to [onChanged] by calling [State.setState] to update the
/// radio button's [groupValue].
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// Here is an example of Radio widgets wrapped in ListTiles, which is similar
/// to what you could get with the RadioListTile widget.
diff --git a/packages/flutter/lib/src/material/radio_list_tile.dart b/packages/flutter/lib/src/material/radio_list_tile.dart
index cfc01247ef..6187cdae96 100644
--- a/packages/flutter/lib/src/material/radio_list_tile.dart
+++ b/packages/flutter/lib/src/material/radio_list_tile.dart
@@ -40,7 +40,7 @@ import 'theme_data.dart';
/// To show the [RadioListTile] as disabled, pass null as the [onChanged]
/// callback.
///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
///
/// 
///
@@ -92,7 +92,7 @@ import 'theme_data.dart';
/// into one. Therefore, it may be necessary to create a custom radio tile
/// widget to accommodate similar use cases.
///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
///
/// 
///
@@ -196,7 +196,7 @@ import 'theme_data.dart';
/// combining [Radio] with other widgets, such as [Text], [Padding] and
/// [InkWell].
///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
///
/// 
///
diff --git a/packages/flutter/lib/src/material/raised_button.dart b/packages/flutter/lib/src/material/raised_button.dart
index 2e2f4debd9..312ddfddb1 100644
--- a/packages/flutter/lib/src/material/raised_button.dart
+++ b/packages/flutter/lib/src/material/raised_button.dart
@@ -31,7 +31,7 @@ import 'theme_data.dart';
/// Raised buttons have a minimum size of 88.0 by 36.0 which can be overridden
/// with [ButtonTheme].
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows how to render a disabled RaisedButton, an enabled RaisedButton
/// and lastly a RaisedButton with gradient background.
diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart
index 76bf1f537a..75b29d5392 100644
--- a/packages/flutter/lib/src/material/scaffold.dart
+++ b/packages/flutter/lib/src/material/scaffold.dart
@@ -807,7 +807,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// [ScaffoldState] for the current [BuildContext] via [Scaffold.of] and use the
/// [ScaffoldState.showSnackBar] and [ScaffoldState.showBottomSheet] functions.
///
-/// {@tool sample --template=stateful_widget_material}
+/// {@tool dartpad --template=stateful_widget_material}
/// This example shows a [Scaffold] with a [body] and [FloatingActionButton].
/// The [body] is a [Text] placed in a [Center] in order to center the text
/// within the [Scaffold]. The [FloatingActionButton] is connected to a
@@ -836,7 +836,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// ```
/// {@end-tool}
///
-/// {@tool sample --template=stateful_widget_material}
+/// {@tool dartpad --template=stateful_widget_material}
/// This example shows a [Scaffold] with a blueGrey [backgroundColor], [body]
/// and [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in
/// order to center the text within the [Scaffold]. The [FloatingActionButton]
@@ -866,7 +866,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// ```
/// {@end-tool}
///
-/// {@tool sample --template=stateful_widget_material}
+/// {@tool dartpad --template=stateful_widget_material}
/// This example shows a [Scaffold] with an [AppBar], a [BottomAppBar] and a
/// [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in order
/// to center the text within the [Scaffold]. The [FloatingActionButton] is
@@ -1098,12 +1098,14 @@ class Scaffold extends StatefulWidget {
///
/// Typically a [Drawer].
///
- /// To open the drawer programmatically, use the [ScaffoldState.openDrawer]
- /// function.
+ /// To open the drawer, use the [ScaffoldState.openDrawer] function.
///
- /// {@tool sample --template=stateful_widget_material}
- /// To disable the drawer edge swipe, set the [Scaffold.drawerEdgeWidth]
- /// to 0. Then, use [ScaffoldState.openDrawer] to open the drawer.
+ /// To close the drawer, use [Navigator.pop].
+ ///
+ /// {@tool dartpad --template=stateful_widget_material}
+ /// To disable the drawer edge swipe, set the [Scaffold.drawerEdgeWidth] to 0.
+ /// Then, use [ScaffoldState.openDrawer] to open the drawer and
+ /// [Navigator.pop] to close it.
///
/// ```dart
/// final GlobalKey _scaffoldKey = GlobalKey();
@@ -1112,19 +1114,34 @@ class Scaffold extends StatefulWidget {
/// _scaffoldKey.currentState.openDrawer();
/// }
///
+ /// void _closeDrawer() {
+ /// Navigator.of(context).pop();
+ /// }
+ ///
/// @override
/// Widget build(BuildContext context) {
/// return Scaffold(
/// key: _scaffoldKey,
- /// appBar: AppBar(title: Text('Drawer Demo')),
+ /// appBar: AppBar(title: const Text('Drawer Demo')),
/// body: Center(
/// child: RaisedButton(
/// onPressed: _openDrawer,
- /// child: Text('Open Drawer'),
+ /// child: const Text('Open Drawer'),
/// ),
/// ),
/// drawer: Drawer(
- /// child: Center(child: Text('This is the Drawer')),
+ /// child: Center(
+ /// child: Column(
+ /// mainAxisAlignment: MainAxisAlignment.center,
+ /// children: [
+ /// const Text('This is the Drawer'),
+ /// RaisedButton(
+ /// onPressed: _closeDrawer,
+ /// child: const Text('Close Drawer'),
+ /// ),
+ /// ],
+ /// ),
+ /// ),
/// ),
/// drawerEdgeDragWidth: 0.0, // Disable opening the drawer with a swipe gesture.
/// );
@@ -1139,12 +1156,14 @@ class Scaffold extends StatefulWidget {
///
/// Typically a [Drawer].
///
- /// To open the drawer programmatically, use the [ScaffoldState.openEndDrawer]
- /// function.
+ /// To open the drawer, use the [ScaffoldState.openEndDrawer] function.
///
- /// {@tool sample --template=stateful_widget_material}
+ /// To close the drawer, use [Navigator.pop].
+ ///
+ /// {@tool dartpad --template=stateful_widget_material}
/// To disable the drawer edge swipe, set the [Scaffold.drawerEdgeWidth]
- /// to 0. Then, use [ScaffoldState.openEndDrawer] to open the drawer.
+ /// to 0. Then, use [ScaffoldState.openEndDrawer] to open the drawer and
+ /// [Navigator.pop] to close it.
///
/// ```dart
/// final GlobalKey _scaffoldKey = GlobalKey();
@@ -1153,6 +1172,10 @@ class Scaffold extends StatefulWidget {
/// _scaffoldKey.currentState.openEndDrawer();
/// }
///
+ /// void _closeEndDrawer() {
+ /// Navigator.of(context).pop();
+ /// }
+ ///
/// @override
/// Widget build(BuildContext context) {
/// return Scaffold(
@@ -1165,7 +1188,18 @@ class Scaffold extends StatefulWidget {
/// ),
/// ),
/// endDrawer: Drawer(
- /// child: Center(child: Text('This is the Drawer')),
+ /// child: Center(
+ /// child: Column(
+ /// mainAxisAlignment: MainAxisAlignment.center,
+ /// children: [
+ /// const Text('This is the Drawer'),
+ /// RaisedButton(
+ /// onPressed: _closeEndDrawer,
+ /// child: const Text('Close Drawer'),
+ /// ),
+ /// ],
+ /// ),
+ /// ),
/// ),
/// drawerEdgeDragWidth: 0.0, // Disable opening the drawer with a swipe gesture.
/// );
@@ -1271,7 +1305,7 @@ class Scaffold extends StatefulWidget {
/// The state from the closest instance of this class that encloses the given context.
///
- /// {@tool sample --template=freeform}
+ /// {@tool dartpad --template=freeform}
/// Typical usage of the [Scaffold.of] function is to call it from within the
/// `build` method of a child of a [Scaffold].
///
@@ -1324,7 +1358,7 @@ class Scaffold extends StatefulWidget {
/// ```
/// {@end-tool}
///
- /// {@tool sample --template=stateless_widget_material}
+ /// {@tool dartpad --template=stateless_widget_material}
/// When the [Scaffold] is actually created in the same `build` function, the
/// `context` argument to the `build` function can't be used to find the
/// [Scaffold] (since it's "above" the widget being returned in the widget
@@ -1879,9 +1913,7 @@ class ScaffoldState extends State with TickerProviderStateMixin {
/// of the app. Modal bottom sheets can be created and displayed with the
/// [showModalBottomSheet] function.
///
- /// {@animation 350 622 https://flutter.github.io/assets-for-api-docs/assets/material/show_bottom_sheet.mp4}
- ///
- /// {@tool sample --template=stateless_widget_scaffold}
+ /// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This example demonstrates how to use `showBottomSheet` to display a
/// bottom sheet when a user taps a button. It also demonstrates how to
diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart
index 643f8fe9e7..1194b90237 100644
--- a/packages/flutter/lib/src/material/stepper.dart
+++ b/packages/flutter/lib/src/material/stepper.dart
@@ -192,7 +192,7 @@ class Stepper extends StatefulWidget {
/// This callback which takes in a context and two functions,[onStepContinue]
/// and [onStepCancel]. These can be used to control the stepper.
///
- /// {@tool sample --template=stateless_widget_scaffold}
+ /// {@tool dartpad --template=stateless_widget_scaffold}
/// Creates a stepper control with custom buttons.
///
/// ```dart
@@ -204,7 +204,7 @@ class Stepper extends StatefulWidget {
/// children: [
/// FlatButton(
/// onPressed: onStepContinue,
- /// child: const Text('CONTINUE'),
+ /// child: const Text('NEXT'),
/// ),
/// FlatButton(
/// onPressed: onStepCancel,
diff --git a/packages/flutter/lib/src/material/switch_list_tile.dart b/packages/flutter/lib/src/material/switch_list_tile.dart
index 9f8215bd06..e3d8a136a6 100644
--- a/packages/flutter/lib/src/material/switch_list_tile.dart
+++ b/packages/flutter/lib/src/material/switch_list_tile.dart
@@ -46,7 +46,7 @@ enum _SwitchListTileType { material, adaptive }
/// To show the [SwitchListTile] as disabled, pass null as the [onChanged]
/// callback.
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// 
///
@@ -85,7 +85,7 @@ enum _SwitchListTileType { material, adaptive }
/// into one. Therefore, it may be necessary to create a custom radio tile
/// widget to accommodate similar use cases.
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// 
///
@@ -169,7 +169,7 @@ enum _SwitchListTileType { material, adaptive }
/// combining [Switch] with other widgets, such as [Text], [Padding] and
/// [InkWell].
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
///
/// 
///
diff --git a/packages/flutter/lib/src/services/keyboard_key.dart b/packages/flutter/lib/src/services/keyboard_key.dart
index 09805906f2..f4eac1bbaa 100644
--- a/packages/flutter/lib/src/services/keyboard_key.dart
+++ b/packages/flutter/lib/src/services/keyboard_key.dart
@@ -45,7 +45,7 @@ abstract class KeyboardKey extends Diagnosticable {
/// look at the physical key to make sure that regardless of the character the
/// key produces, you got the key that is in that location on the keyboard.
///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
/// This example shows how to detect if the user has selected the logical "Q"
/// key.
///
@@ -1960,7 +1960,7 @@ class LogicalKeyboardKey extends KeyboardKey {
/// looking for "the key next next to the TAB key", since on a French keyboard,
/// the key next to the TAB key has an "A" on it.
///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
/// This example shows how to detect if the user has selected the physical key
/// to the right of the CAPS LOCK key.
///
diff --git a/packages/flutter/lib/src/widgets/actions.dart b/packages/flutter/lib/src/widgets/actions.dart
index 265850c773..d13cbaa645 100644
--- a/packages/flutter/lib/src/widgets/actions.dart
+++ b/packages/flutter/lib/src/widgets/actions.dart
@@ -371,7 +371,7 @@ class Actions extends InheritedWidget {
/// widget, and the new control should be enabled for keyboard traversal and
/// activation.
///
-/// {@tool sample --template=stateful_widget_material}
+/// {@tool dartpad --template=stateful_widget_material}
/// This example shows how keyboard interaction can be added to a custom control
/// that changes color when hovered and focused, and can toggle a light when
/// activated, either by touch or by hitting the `X` key on the keyboard.
diff --git a/packages/flutter/lib/src/widgets/animated_list.dart b/packages/flutter/lib/src/widgets/animated_list.dart
index bdcec6f4f5..e941cfd62f 100644
--- a/packages/flutter/lib/src/widgets/animated_list.dart
+++ b/packages/flutter/lib/src/widgets/animated_list.dart
@@ -48,7 +48,7 @@ class _ActiveItem implements Comparable<_ActiveItem> {
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=ZtfItHwFlZ8}
///
-/// {@tool sample --template=freeform}
+/// {@tool dartpad --template=freeform}
/// This sample application uses an [AnimatedList] to create an effect when
/// items are removed or added to the list.
///
@@ -241,7 +241,7 @@ class _ActiveItem implements Comparable<_ActiveItem> {
/// behavior: HitTestBehavior.opaque,
/// onTap: onTap,
/// child: SizedBox(
-/// height: 128.0,
+/// height: 80.0,
/// child: Card(
/// color: Colors.primaries[item % Colors.primaries.length],
/// child: Center(
@@ -490,7 +490,7 @@ class AnimatedListState extends State with TickerProviderStateMixi
/// [GlobalKey] or use the static [SliverAnimatedList.of] method from an item's
/// input callback.
///
-/// {@tool sample --template=freeform}
+/// {@tool dartpad --template=freeform}
/// This sample application uses a [SliverAnimatedList] to create an animated
/// effect when items are removed or added to the list.
///
@@ -588,21 +588,21 @@ class AnimatedListState extends State with TickerProviderStateMixi
/// 'SliverAnimatedList',
/// style: TextStyle(fontSize: 30),
/// ),
-/// expandedHeight: 100,
+/// expandedHeight: 60,
/// centerTitle: true,
/// backgroundColor: Colors.amber[900],
/// leading: IconButton(
/// icon: const Icon(Icons.add_circle),
/// onPressed: _insert,
/// tooltip: 'Insert a new item.',
-/// iconSize: 48,
+/// iconSize: 32,
/// ),
/// actions: [
/// IconButton(
/// icon: const Icon(Icons.remove_circle),
/// onPressed: _remove,
/// tooltip: 'Remove the selected item.',
-/// iconSize: 48,
+/// iconSize: 32,
/// ),
/// ],
/// ),
@@ -704,7 +704,7 @@ class AnimatedListState extends State with TickerProviderStateMixi
/// child: GestureDetector(
/// onTap: onTap,
/// child: SizedBox(
-/// height: 120.0,
+/// height: 80.0,
/// child: Card(
/// color: selected
/// ? Colors.black12
diff --git a/packages/flutter/lib/src/widgets/async.dart b/packages/flutter/lib/src/widgets/async.dart
index c2530ea1d0..b3787f2ff5 100644
--- a/packages/flutter/lib/src/widgets/async.dart
+++ b/packages/flutter/lib/src/widgets/async.dart
@@ -339,11 +339,7 @@ typedef AsyncWidgetBuilder = Widget Function(BuildContext context, AsyncSnaps
/// as the builder will always be called before the stream listener has a chance
/// to be processed.
///
-/// {@animation 200 150 https://flutter.github.io/assets-for-api-docs/assets/widgets/stream_builder.mp4}
-///
-/// {@animation 200 150 https://flutter.github.io/assets-for-api-docs/assets/widgets/stream_builder_error.mp4}
-///
-/// {@tool sample --template=stateful_widget_material}
+/// {@tool dartpad --template=stateful_widget_material}
///
/// This sample shows a [StreamBuilder] that listens to a Stream that emits bids
/// for an auction. Every time the StreamBuilder receives a bid from the Stream,
@@ -359,89 +355,92 @@ typedef AsyncWidgetBuilder = Widget Function(BuildContext context, AsyncSnaps
/// })();
///
/// Widget build(BuildContext context) {
-/// return Container(
-/// alignment: FractionalOffset.center,
-/// color: Colors.white,
-/// child: StreamBuilder(
-/// stream: _bids,
-/// builder: (BuildContext context, AsyncSnapshot snapshot) {
-/// List children;
-///
-/// if (snapshot.hasError) {
-/// children = [
-/// Icon(
-/// Icons.error_outline,
-/// color: Colors.red,
-/// size: 60,
-/// ),
-/// Padding(
-/// padding: const EdgeInsets.only(top: 16),
-/// child: Text('Error: ${snapshot.error}'),
-/// )
-/// ];
-/// } else {
-/// switch (snapshot.connectionState) {
-/// case ConnectionState.none:
-/// children = [
-/// Icon(
-/// Icons.info,
-/// color: Colors.blue,
-/// size: 60,
-/// ),
-/// const Padding(
-/// padding: EdgeInsets.only(top: 16),
-/// child: Text('Select a lot'),
-/// )
-/// ];
-/// break;
-/// case ConnectionState.waiting:
-/// children = [
-/// SizedBox(
-/// child: const CircularProgressIndicator(),
-/// width: 60,
-/// height: 60,
-/// ),
-/// const Padding(
-/// padding: EdgeInsets.only(top: 16),
-/// child: Text('Awaiting bids...'),
-/// )
-/// ];
-/// break;
-/// case ConnectionState.active:
-/// children = [
-/// Icon(
-/// Icons.check_circle_outline,
-/// color: Colors.green,
-/// size: 60,
-/// ),
-/// Padding(
-/// padding: const EdgeInsets.only(top: 16),
-/// child: Text('\$${snapshot.data}'),
-/// )
-/// ];
-/// break;
-/// case ConnectionState.done:
-/// children = [
-/// Icon(
-/// Icons.info,
-/// color: Colors.blue,
-/// size: 60,
-/// ),
-/// Padding(
-/// padding: const EdgeInsets.only(top: 16),
-/// child: Text('\$${snapshot.data} (closed)'),
-/// )
-/// ];
-/// break;
+/// return DefaultTextStyle(
+/// style: Theme.of(context).textTheme.headline2,
+/// textAlign: TextAlign.center,
+/// child: Container(
+/// alignment: FractionalOffset.center,
+/// color: Colors.white,
+/// child: StreamBuilder(
+/// stream: _bids,
+/// builder: (BuildContext context, AsyncSnapshot snapshot) {
+/// List children;
+/// if (snapshot.hasError) {
+/// children = [
+/// Icon(
+/// Icons.error_outline,
+/// color: Colors.red,
+/// size: 60,
+/// ),
+/// Padding(
+/// padding: const EdgeInsets.only(top: 16),
+/// child: Text('Error: ${snapshot.error}'),
+/// )
+/// ];
+/// } else {
+/// switch (snapshot.connectionState) {
+/// case ConnectionState.none:
+/// children = [
+/// Icon(
+/// Icons.info,
+/// color: Colors.blue,
+/// size: 60,
+/// ),
+/// const Padding(
+/// padding: EdgeInsets.only(top: 16),
+/// child: Text('Select a lot'),
+/// )
+/// ];
+/// break;
+/// case ConnectionState.waiting:
+/// children = [
+/// SizedBox(
+/// child: const CircularProgressIndicator(),
+/// width: 60,
+/// height: 60,
+/// ),
+/// const Padding(
+/// padding: EdgeInsets.only(top: 16),
+/// child: Text('Awaiting bids...'),
+/// )
+/// ];
+/// break;
+/// case ConnectionState.active:
+/// children = [
+/// Icon(
+/// Icons.check_circle_outline,
+/// color: Colors.green,
+/// size: 60,
+/// ),
+/// Padding(
+/// padding: const EdgeInsets.only(top: 16),
+/// child: Text('\$${snapshot.data}'),
+/// )
+/// ];
+/// break;
+/// case ConnectionState.done:
+/// children = [
+/// Icon(
+/// Icons.info,
+/// color: Colors.blue,
+/// size: 60,
+/// ),
+/// Padding(
+/// padding: const EdgeInsets.only(top: 16),
+/// child: Text('\$${snapshot.data} (closed)'),
+/// )
+/// ];
+/// break;
+/// }
/// }
-/// }
///
-/// return Column(
-/// mainAxisAlignment: MainAxisAlignment.center,
-/// crossAxisAlignment: CrossAxisAlignment.center,
-/// children: children,
-/// );
-/// },
+/// return Column(
+/// mainAxisAlignment: MainAxisAlignment.center,
+/// crossAxisAlignment: CrossAxisAlignment.center,
+/// children: children,
+/// );
+/// },
+/// ),
/// ),
/// );
/// }
@@ -574,11 +573,7 @@ class StreamBuilder extends StreamBuilderBase> {
/// `future?.asStream()`, except that snapshots with `ConnectionState.active`
/// may appear for the latter, depending on how the stream is implemented.
///
-/// {@animation 200 150 https://flutter.github.io/assets-for-api-docs/assets/widgets/future_builder.mp4}
-///
-/// {@animation 200 150 https://flutter.github.io/assets-for-api-docs/assets/widgets/future_builder_error.mp4}
-///
-/// {@tool sample --template=stateful_widget_material}
+/// {@tool dartpad --template=stateful_widget_material}
///
/// This sample shows a [FutureBuilder] that displays a loading spinner while it
/// loads data. It displays a success icon and text if the [Future] completes
@@ -593,56 +588,59 @@ class StreamBuilder extends StreamBuilderBase> {
/// );
///
/// Widget build(BuildContext context) {
-/// return FutureBuilder(
-/// future: _calculation, // a previously-obtained Future or null
-/// builder: (BuildContext context, AsyncSnapshot snapshot) {
-/// List children;
-///
-/// if (snapshot.hasData) {
-/// children = [
-/// Icon(
-/// Icons.check_circle_outline,
-/// color: Colors.green,
-/// size: 60,
+/// return DefaultTextStyle(
+/// style: Theme.of(context).textTheme.headline2,
+/// textAlign: TextAlign.center,
+/// child: FutureBuilder(
+/// future: _calculation, // a previously-obtained Future or null
+/// builder: (BuildContext context, AsyncSnapshot snapshot) {
+/// List children;
+/// if (snapshot.hasData) {
+/// children = [
+/// Icon(
+/// Icons.check_circle_outline,
+/// color: Colors.green,
+/// size: 60,
+/// ),
+/// Padding(
+/// padding: const EdgeInsets.only(top: 16),
+/// child: Text('Result: ${snapshot.data}'),
+/// )
+/// ];
+/// } else if (snapshot.hasError) {
+/// children = [
+/// Icon(
+/// Icons.error_outline,
+/// color: Colors.red,
+/// size: 60,
+/// ),
+/// Padding(
+/// padding: const EdgeInsets.only(top: 16),
+/// child: Text('Error: ${snapshot.error}'),
+/// )
+/// ];
+/// } else {
+/// children = [
+/// SizedBox(
+/// child: CircularProgressIndicator(),
+/// width: 60,
+/// height: 60,
+/// ),
+/// const Padding(
+/// padding: EdgeInsets.only(top: 16),
+/// child: Text('Awaiting result...'),
+/// )
+/// ];
+/// }
+/// return Center(
+/// child: Column(
+/// mainAxisAlignment: MainAxisAlignment.center,
+/// crossAxisAlignment: CrossAxisAlignment.center,
+/// children: children,
/// ),
-/// Padding(
-/// padding: const EdgeInsets.only(top: 16),
-/// child: Text('Result: ${snapshot.data}'),
-/// )
-/// ];
-/// } else if (snapshot.hasError) {
-/// children = [
-/// Icon(
-/// Icons.error_outline,
-/// color: Colors.red,
-/// size: 60,
-/// ),
-/// Padding(
-/// padding: const EdgeInsets.only(top: 16),
-/// child: Text('Error: ${snapshot.error}'),
-/// )
-/// ];
-/// } else {
-/// children = [
-/// SizedBox(
-/// child: CircularProgressIndicator(),
-/// width: 60,
-/// height: 60,
-/// ),
-/// const Padding(
-/// padding: EdgeInsets.only(top: 16),
-/// child: Text('Awaiting result...'),
-/// )
-/// ];
-/// }
-/// return Center(
-/// child: Column(
-/// mainAxisAlignment: MainAxisAlignment.center,
-/// crossAxisAlignment: CrossAxisAlignment.center,
-/// children: children,
-/// ),
-/// );
-/// },
+/// );
+/// },
+/// ),
/// );
/// }
/// ```
diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart
index e3a70f30aa..765a5fc00b 100644
--- a/packages/flutter/lib/src/widgets/basic.dart
+++ b/packages/flutter/lib/src/widgets/basic.dart
@@ -4444,7 +4444,7 @@ class Flexible extends ParentDataWidget {
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=_rnZaagadyo}
///
-/// {@tool sample --template=stateless_widget_material}
+/// {@tool dartpad --template=stateless_widget_material}
/// This example shows how to use an [Expanded] widget in a [Column] so that
/// it's middle child, a [Container] here, expands to fill the space.
///
@@ -4483,7 +4483,7 @@ class Flexible extends ParentDataWidget {
/// ```
/// {@end-tool}
///
-/// {@tool sample --template=stateless_widget_material}
+/// {@tool dartpad --template=stateless_widget_material}
/// This example shows how to use an [Expanded] widget in a [Row] with multiple
/// children expanded, utilizing the [flex] factor to prioritize available space.
///
@@ -4826,9 +4826,7 @@ class Wrap extends MultiChildRenderObjectWidget {
/// * The [catalog of layout widgets](https://flutter.dev/widgets/layout/).
///
///
-/// {@animation 450 100 https://flutter.github.io/assets-for-api-docs/assets/widgets/flow_menu.mp4}
-///
-/// {@tool sample --template=freeform}
+/// {@tool dartpad --template=freeform}
///
/// This example uses the [Flow] widget to create a menu that opens and closes
/// as it is interacted with, shown above. The color of the button in the menu
@@ -5542,7 +5540,7 @@ class WidgetToRenderBoxAdapter extends LeafRenderObjectWidget {
/// If it has a child, this widget defers to the child for sizing behavior. If
/// it does not have a child, it grows to fit the parent instead.
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
/// This example makes a [Container] react to being touched, showing a count of
/// the number of pointer downs and ups.
///
@@ -5795,7 +5793,7 @@ class _PointerListener extends SingleChildRenderObjectWidget {
/// If it has a child, this widget defers to the child for sizing behavior. If
/// it does not have a child, it grows to fit the parent instead.
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
/// This example makes a [Container] react to being entered by a mouse
/// pointer, showing a count of the number of entries and exits.
///
@@ -5949,7 +5947,7 @@ class MouseRegion extends StatefulWidget {
/// override [State.dispose] and call [onExit], or create your own widget
/// using [RenderMouseRegion].
///
- /// {@tool sample --template=stateful_widget_scaffold_center}
+ /// {@tool dartpad --template=stateful_widget_scaffold_center}
/// The following example shows a blue rectangular that turns yellow when
/// hovered. Since the hover state is completely contained within a widget
/// that unconditionally creates the `MouseRegion`, you can ignore the
@@ -5977,7 +5975,7 @@ class MouseRegion extends StatefulWidget {
/// ```
/// {@end-tool}
///
- /// {@tool sample --template=stateful_widget_scaffold_center}
+ /// {@tool dartpad --template=stateful_widget_scaffold_center}
/// The following example shows a widget that hides its content one second
/// after behing hovered, and also exposes the enter and exit callbacks.
/// Because the widget conditionally creates the `MouseRegion`, and leaks the
diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart
index 04a35f7196..f9a13076c8 100644
--- a/packages/flutter/lib/src/widgets/editable_text.dart
+++ b/packages/flutter/lib/src/widgets/editable_text.dart
@@ -70,7 +70,7 @@ const int _kObscureShowLatestCharCursorTicks = 3;
///
/// Remember to [dispose] of the [TextEditingController] when it is no longer needed.
/// This will ensure we discard any resources used by the object.
-/// {@tool sample --template=stateful_widget_material}
+/// {@tool dartpad --template=stateful_widget_material}
/// This example creates a [TextField] with a [TextEditingController] whose
/// change listener forces the entered text to be lower case and keeps the
/// cursor at the end of the input.
@@ -872,7 +872,7 @@ class EditableText extends StatefulWidget {
/// field.
/// {@endtemplate}
///
- /// {@tool sample --template=stateful_widget_material}
+ /// {@tool dartpad --template=stateful_widget_material}
/// When a non-completion action is pressed, such as "next" or "previous", it
/// is often desirable to move the focus to the next or previous field. To do
/// this, handle it as in this example, by calling [FocusNode.focusNext] in
diff --git a/packages/flutter/lib/src/widgets/focus_manager.dart b/packages/flutter/lib/src/widgets/focus_manager.dart
index 7fc642a0bf..f92da0013a 100644
--- a/packages/flutter/lib/src/widgets/focus_manager.dart
+++ b/packages/flutter/lib/src/widgets/focus_manager.dart
@@ -239,7 +239,7 @@ class FocusAttachment {
/// [ReadingOrderTraversalPolicy], and [DirectionalFocusTraversalPolicyMixin],
/// but custom policies can be built based upon these policies.
///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
/// This example shows how a FocusNode should be managed if not using the
/// [Focus] or [FocusScope] widgets. See the [Focus] widget for a similar
/// example using [Focus] and [FocusScope] widgets.
diff --git a/packages/flutter/lib/src/widgets/focus_scope.dart b/packages/flutter/lib/src/widgets/focus_scope.dart
index 5c357e4f32..cb9ce512a9 100644
--- a/packages/flutter/lib/src/widgets/focus_scope.dart
+++ b/packages/flutter/lib/src/widgets/focus_scope.dart
@@ -38,7 +38,7 @@ import 'inherited_notifier.dart';
///
/// To collect a sub-tree of nodes into a group, use a [FocusScope].
///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
/// This example shows how to manage focus using the [Focus] and [FocusScope]
/// widgets. See [FocusNode] for a similar example that doesn't use [Focus] or
/// [FocusScope].
diff --git a/packages/flutter/lib/src/widgets/form.dart b/packages/flutter/lib/src/widgets/form.dart
index cea394b146..5213df1afe 100644
--- a/packages/flutter/lib/src/widgets/form.dart
+++ b/packages/flutter/lib/src/widgets/form.dart
@@ -16,7 +16,7 @@ import 'will_pop_scope.dart';
/// with a context whose ancestor is the [Form], or pass a [GlobalKey] to the
/// [Form] constructor and call [GlobalKey.currentState].
///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
/// This example shows a [Form] with one [TextFormField] to enter an email
/// address and a [RaisedButton] to submit the form. A [GlobalKey] is used here
/// to identify the [Form] and validate input.
diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart
index d09b8d3699..f373af5cca 100644
--- a/packages/flutter/lib/src/widgets/image.dart
+++ b/packages/flutter/lib/src/widgets/image.dart
@@ -688,7 +688,7 @@ class Image extends StatefulWidget {
/// ```
/// {@endtemplate}
///
- /// {@tool sample --template=stateless_widget_material}
+ /// {@tool dartpad --template=stateless_widget_material}
///
/// The following sample demonstrates how to use this builder to implement an
/// image that fades in once it's been loaded.
@@ -706,7 +706,7 @@ class Image extends StatefulWidget {
/// borderRadius: BorderRadius.circular(20),
/// ),
/// child: Image.network(
- /// 'https://example.com/image.jpg',
+ /// 'https://flutter.github.io/assets-for-api-docs/assets/widgets/puffin.jpg',
/// frameBuilder: (BuildContext context, Widget child, int frame, bool wasSynchronouslyLoaded) {
/// if (wasSynchronouslyLoaded) {
/// return child;
@@ -723,11 +723,6 @@ class Image extends StatefulWidget {
/// }
/// ```
/// {@end-tool}
- ///
- /// Run against a real-world image, the previous example renders the following
- /// image.
- ///
- /// {@animation 400 400 https://flutter.github.io/assets-for-api-docs/assets/widgets/frame_builder_image.mp4}
final ImageFrameBuilder frameBuilder;
/// A builder that specifies the widget to display to the user while an image
@@ -759,7 +754,7 @@ class Image extends StatefulWidget {
///
/// {@macro flutter.widgets.image.chainedBuildersExample}
///
- /// {@tool sample --template=stateless_widget_material}
+ /// {@tool dartpad --template=stateless_widget_material}
///
/// The following sample uses [loadingBuilder] to show a
/// [CircularProgressIndicator] while an image loads over the network.
@@ -791,9 +786,9 @@ class Image extends StatefulWidget {
/// ```
/// {@end-tool}
///
- /// Run against a real-world image, the previous example renders the following
- /// loading progress indicator while the image loads before rendering the
- /// completed image.
+ /// Run against a real-world image on a slow network, the previous example
+ /// renders the following loading progress indicator while the image loads
+ /// before rendering the completed image.
///
/// {@animation 400 400 https://flutter.github.io/assets-for-api-docs/assets/widgets/loading_progress_image.mp4}
final ImageLoadingBuilder loadingBuilder;
diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart
index a6ba5360d5..562f68682a 100644
--- a/packages/flutter/lib/src/widgets/implicit_animations.dart
+++ b/packages/flutter/lib/src/widgets/implicit_animations.dart
@@ -574,11 +574,7 @@ abstract class AnimatedWidgetBaseState exten
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=yI-8QHpGIP4}
///
-/// Here's an illustration (implemented below) 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_container.mp4}
-///
-/// {@tool sample --template=stateful_widget_scaffold}
+/// {@tool dartpad --template=stateful_widget_scaffold}
///
/// The following example (depicted above) transitions an AnimatedContainer
/// between two states. It adjusts the [height], [width], [color], and
@@ -1378,9 +1374,7 @@ class _AnimatedOpacityState extends ImplicitlyAnimatedWidgetState` to the [NestedScrollView.key] parameter).
///
-/// {@tool sample --template=stateless_widget_material}
+/// {@tool dartpad --template=stateless_widget_material}
/// [NestedScrollViewState] can be obtained using a [GlobalKey].
/// Using the following setup, you can access the inner scroll controller
/// using `globalKey.currentState.innerController`.
diff --git a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart
index 7a9a4b2b3f..6b5dc18c7a 100644
--- a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart
+++ b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart
@@ -80,7 +80,7 @@ import 'scrollable.dart';
/// with some remaining space to allocate as specified by its
/// [Column.mainAxisAlignment] argument.
///
-/// {@tool sample --template=stateless_widget}
+/// {@tool dartpad --template=stateless_widget_material}
/// In this example, the children are spaced out equally, unless there's no more
/// room, in which case they stack vertically and scroll.
///
@@ -88,38 +88,43 @@ import 'scrollable.dart';
/// in both cases the "available space" is infinite (since this is in a viewport).
/// The next section describes a technique for providing a maximum height constraint.
///
-/// 
-///
/// ```dart
-/// Widget build(BuildContext context) {
-/// return LayoutBuilder(
-/// builder: (BuildContext context, BoxConstraints viewportConstraints) {
-/// return SingleChildScrollView(
-/// child: ConstrainedBox(
-/// constraints: BoxConstraints(
-/// minHeight: viewportConstraints.maxHeight,
-/// ),
-/// child: Column(
-/// mainAxisSize: MainAxisSize.min,
-/// mainAxisAlignment: MainAxisAlignment.spaceAround,
-/// children: [
-/// Container(
-/// // A fixed-height child.
-/// color: const Color(0xff808000), // Yellow
-/// height: 120.0,
-/// ),
-/// Container(
-/// // Another fixed-height child.
-/// color: const Color(0xff008000), // Green
-/// height: 120.0,
-/// ),
-/// ],
-/// ),
-/// ),
-/// );
-/// },
-/// );
-/// }
+/// Widget build(BuildContext context) {
+/// return DefaultTextStyle(
+/// style: Theme.of(context).textTheme.bodyText2,
+/// child: LayoutBuilder(
+/// builder: (BuildContext context, BoxConstraints viewportConstraints) {
+/// return SingleChildScrollView(
+/// child: ConstrainedBox(
+/// constraints: BoxConstraints(
+/// minHeight: viewportConstraints.maxHeight,
+/// ),
+/// child: Column(
+/// mainAxisSize: MainAxisSize.min,
+/// mainAxisAlignment: MainAxisAlignment.spaceAround,
+/// children: [
+/// Container(
+/// // A fixed-height child.
+/// color: const Color(0xffeeee00), // Yellow
+/// height: 120.0,
+/// alignment: Alignment.center,
+/// child: const Text('Fixed Height Content'),
+/// ),
+/// Container(
+/// // Another fixed-height child.
+/// color: const Color(0xff008000), // Green
+/// height: 120.0,
+/// alignment: Alignment.center,
+/// child: const Text('Fixed Height Content'),
+/// ),
+/// ],
+/// ),
+/// ),
+/// );
+/// },
+/// ),
+/// );
+/// }
/// ```
/// {@end-tool}
///
@@ -149,45 +154,50 @@ import 'scrollable.dart';
/// so that the intrinsic sizing algorithm can short-circuit the computation when it
/// reaches those parts of the subtree.
///
-/// {@tool sample --template=stateless_widget}
+/// {@tool dartpad --template=stateless_widget_material}
/// In this example, the column becomes either as big as viewport, or as big as
/// the contents, whichever is biggest.
///
-/// 
-///
/// ```dart
-/// Widget build(BuildContext context) {
-/// return LayoutBuilder(
-/// builder: (BuildContext context, BoxConstraints viewportConstraints) {
-/// return SingleChildScrollView(
-/// child: ConstrainedBox(
-/// constraints: BoxConstraints(
-/// minHeight: viewportConstraints.maxHeight,
-/// ),
-/// child: IntrinsicHeight(
-/// child: Column(
-/// children: [
-/// Container(
-/// // A fixed-height child.
-/// color: const Color(0xff808000), // Yellow
-/// height: 120.0,
-/// ),
-/// Expanded(
-/// // A flexible child that will grow to fit the viewport but
-/// // still be at least as big as necessary to fit its contents.
-/// child: Container(
-/// color: const Color(0xff800000), // Red
-/// height: 120.0,
-/// ),
-/// ),
-/// ],
-/// ),
-/// ),
-/// ),
-/// );
-/// },
-/// );
-/// }
+/// Widget build(BuildContext context) {
+/// return DefaultTextStyle(
+/// style: Theme.of(context).textTheme.bodyText2,
+/// child: LayoutBuilder(
+/// builder: (BuildContext context, BoxConstraints viewportConstraints) {
+/// return SingleChildScrollView(
+/// child: ConstrainedBox(
+/// constraints: BoxConstraints(
+/// minHeight: viewportConstraints.maxHeight,
+/// ),
+/// child: IntrinsicHeight(
+/// child: Column(
+/// children: [
+/// Container(
+/// // A fixed-height child.
+/// color: const Color(0xffeeee00), // Yellow
+/// height: 120.0,
+/// alignment: Alignment.center,
+/// child: const Text('Fixed Height Content'),
+/// ),
+/// Expanded(
+/// // A flexible child that will grow to fit the viewport but
+/// // still be at least as big as necessary to fit its contents.
+/// child: Container(
+/// color: const Color(0xffee0000), // Red
+/// height: 120.0,
+/// alignment: Alignment.center,
+/// child: const Text('Flexible Content'),
+/// ),
+/// ),
+/// ],
+/// ),
+/// ),
+/// ),
+/// );
+/// },
+/// ),
+/// );
+/// }
/// ```
/// {@end-tool}
///
diff --git a/packages/flutter/lib/src/widgets/sliver_fill.dart b/packages/flutter/lib/src/widgets/sliver_fill.dart
index cd06bb767a..6d9fcae447 100644
--- a/packages/flutter/lib/src/widgets/sliver_fill.dart
+++ b/packages/flutter/lib/src/widgets/sliver_fill.dart
@@ -196,9 +196,7 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding {
/// the amount of space that has been scrolled beforehand has not exceeded the
/// main axis extent of the viewport.
///
-/// {@animation 250 500 https://flutter.github.io/assets-for-api-docs/assets/widgets/sliver_fill_remaining_sizes_child.mp4}
-///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// In this sample the [SliverFillRemaining] sizes its [child] to fill the
/// remaining extent of the viewport in both axes. The icon is centered in the
@@ -234,9 +232,7 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding {
/// [SliverFillRemaining] will defer to the size of its [child] if the
/// child's size exceeds the remaining space in the viewport.
///
-/// {@animation 250 500 https://flutter.github.io/assets-for-api-docs/assets/widgets/sliver_fill_remaining_defers_to_child.mp4}
-///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// In this sample the [SliverFillRemaining] defers to the size of its [child]
/// because the child's extent exceeds that of the remaining extent of the
@@ -278,9 +274,7 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding {
/// [SliverFillRemaining] will defer to the size of its [child] if the
/// [precedingScrollExtent] exceeded the length of the viewport's main axis.
///
-/// {@animation 250 500 https://flutter.github.io/assets-for-api-docs/assets/widgets/sliver_fill_remaining_scrolled_beyond.mp4}
-///
-/// {@tool sample --template=stateless_widget_scaffold}
+/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// In this sample the [SliverFillRemaining] defers to the size of its [child]
/// because the [precedingScrollExtent] of the [SliverConstraints] has gone
@@ -336,6 +330,9 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding {
/// button that is pinned to the bottom of the sliver, regardless of size or
/// overscroll behavior. Try switching [fillOverscroll] to see the difference.
///
+/// This sample only shows the overscroll behavior on devices that support
+/// overscroll.
+///
/// ```dart
/// Widget build(BuildContext context) {
/// return CustomScrollView(
diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart
index cac6012278..72093cec1b 100644
--- a/packages/flutter/lib/src/widgets/transitions.dart
+++ b/packages/flutter/lib/src/widgets/transitions.dart
@@ -194,7 +194,7 @@ class _AnimatedState extends State {
/// animated by a [CurvedAnimation] set to [Curves.elasticIn]:
/// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/slide_transition.mp4}
///
-/// {@tool sample --template=stateful_widget_scaffold_center_freeform_state}
+/// {@tool dartpad --template=stateful_widget_scaffold_center_freeform_state}
/// The following code implements the [SlideTransition] as seen in the video
/// above:
///
@@ -583,7 +583,7 @@ class FadeTransition extends SingleChildRenderObjectWidget {
/// Animates the opacity of a sliver widget.
///
-/// {@tool sample --template=stateful_widget_scaffold_center_freeform_state}
+/// {@tool dartpad --template=stateful_widget_scaffold_center_freeform_state}
/// Creates a [CustomScrollView] with a [SliverFixedExtentList] that uses a
/// [SliverFadeTransition] to fade the list in and out.
///
diff --git a/packages/flutter/lib/src/widgets/tween_animation_builder.dart b/packages/flutter/lib/src/widgets/tween_animation_builder.dart
index c26cc15b93..549bbae81e 100644
--- a/packages/flutter/lib/src/widgets/tween_animation_builder.dart
+++ b/packages/flutter/lib/src/widgets/tween_animation_builder.dart
@@ -59,7 +59,7 @@ import 'value_listenable_builder.dart';
///
/// ## Example Code
///
-/// {@tool sample --template=stateful_widget_scaffold_center}
+/// {@tool dartpad --template=stateful_widget_scaffold_center}
/// This example shows an [IconButton] that "zooms" in when the widget first
/// builds (its size smoothly increases from 0 to 24) and whenever the button
/// is pressed, it smoothly changes its size to the new target value of either