Unverified Commit a6e90113 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Convert existing '## Sample code' samples to '{@tool sample}...{@end-tool}' form. (#24077)

This converts existing ## Sample code samples to {@tool sample}...{@end-tool} form.

Also:
1. Fixed a minor bug in analyze-sample-code.dart
2. Made the snippet tool only insert descriptions if the description is non-empty.
3. Moved the Card diagram to before the code sample.
parent 9d53d7f8
...@@ -715,7 +715,7 @@ class Line { ...@@ -715,7 +715,7 @@ class Line {
final String code; final String code;
String toStringWithColumn(int column) { String toStringWithColumn(int column) {
if (column != null) { if (column != null && indent != null) {
return '$filename:$line:${column + indent}: $code'; return '$filename:$line:${column + indent}: $code';
} }
return toString(); return toString();
......
...@@ -5,11 +5,7 @@ ...@@ -5,11 +5,7 @@
</div> </div>
<div class="snippet-container"> <div class="snippet-container">
<div class="snippet" id="shortSnippet"> <div class="snippet" id="shortSnippet">
<div class="snippet-description">
{@end-inject-html}
{{description}} {{description}}
{@inject-html}
</div>
<div class="copyable-container"> <div class="copyable-container">
<button class="copy-button-overlay copy-button" title="Copy to clipboard" <button class="copy-button-overlay copy-button" title="Copy to clipboard"
onclick="copyTextToClipboard();"> onclick="copyTextToClipboard();">
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
<button id="shortSnippetButton" selected>Sample</button> <button id="shortSnippetButton" selected>Sample</button>
</div> </div>
<div class="snippet-container"> <div class="snippet-container">
<div class="snippet"> <div class="snippet">{{description}}
<div class="snippet-description">{@end-inject-html}
{{description}}{@inject-html}
</div>
<div class="copyable-container"> <div class="copyable-container">
<button class="copy-button-overlay copy-button" title="Copy to clipboard" <button class="copy-button-overlay copy-button" title="Copy to clipboard"
onclick="copyTextToClipboard(findSiblingWithId(this, 'sample-code'));"> onclick="copyTextToClipboard(findSiblingWithId(this, 'sample-code'));">
......
...@@ -25,6 +25,6 @@ class MyStatelessWidget extends StatelessWidget { ...@@ -25,6 +25,6 @@ class MyStatelessWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return {{code}} return {{code}};
} }
} }
...@@ -113,10 +113,15 @@ class SnippetGenerator { ...@@ -113,10 +113,15 @@ class SnippetGenerator {
if (result.length > 3) { if (result.length > 3) {
result.removeRange(result.length - 3, result.length); result.removeRange(result.length - 3, result.length);
} }
// Only insert a div for the description if there actually is some text there.
// This means that the {{description}} marker in the skeleton needs to
// be inside of an {@inject-html} block.
String description = injections.firstWhere((_ComponentTuple tuple) => tuple.name == 'description').mergedContent;
description = description.trim().isNotEmpty
? '<div class="snippet-description">{@end-inject-html}$description{@inject-html}</div>'
: '';
final Map<String, String> substitutions = <String, String>{ final Map<String, String> substitutions = <String, String>{
'description': injections 'description': description,
.firstWhere((_ComponentTuple tuple) => tuple.name == 'description')
.mergedContent,
'code': htmlEscape.convert(result.join('\n')), 'code': htmlEscape.convert(result.join('\n')),
'language': language ?? 'dart', 'language': language ?? 'dart',
}..addAll(type == SnippetType.application }..addAll(type == SnippetType.application
......
...@@ -106,7 +106,9 @@ void main() { ...@@ -106,7 +106,9 @@ void main() {
expect(html, contains('<div>HTML Bits</div>')); expect(html, contains('<div>HTML Bits</div>'));
expect(html, contains('<div>More HTML Bits</div>')); expect(html, contains('<div>More HTML Bits</div>'));
expect(html, contains(' print(&#39;The actual \$name.&#39;);')); expect(html, contains(' print(&#39;The actual \$name.&#39;);'));
expect(html, contains('A description of the snippet.\n\nOn several lines.\n')); expect(html, contains('<div class="snippet-description">'
'{@end-inject-html}A description of the snippet.\n\n'
'On several lines.{@inject-html}</div>\n'));
expect(html, contains('main() {')); expect(html, contains('main() {'));
}); });
}); });
......
...@@ -101,7 +101,7 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> { ...@@ -101,7 +101,7 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> {
/// argument to the method (`child`), whose value is derived by applying the /// argument to the method (`child`), whose value is derived by applying the
/// given [Tween] to the value of this [Animation]. /// given [Tween] to the value of this [Animation].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Given an [AnimationController] `_controller`, the following code creates /// Given an [AnimationController] `_controller`, the following code creates
/// an `Animation<Alignment>` that swings from top left to top right as the /// an `Animation<Alignment>` that swings from top left to top right as the
...@@ -115,6 +115,8 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> { ...@@ -115,6 +115,8 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> {
/// ), /// ),
/// ); /// );
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// The `_alignment.value` could then be used in a widget's build method, for /// The `_alignment.value` could then be used in a widget's build method, for
/// instance, to position a child using an [Align] widget such that the /// instance, to position a child using an [Align] widget such that the
...@@ -133,6 +135,8 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> { ...@@ -133,6 +135,8 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> {
/// // ... /// // ...
/// Animation<Alignment> _alignment2 = _controller.drive(_tween); /// Animation<Alignment> _alignment2 = _controller.drive(_tween);
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// The following code is exactly equivalent, and is typically clearer when /// The following code is exactly equivalent, and is typically clearer when
/// the tweens are created inline, as might be preferred when the tweens have /// the tweens are created inline, as might be preferred when the tweens have
...@@ -146,6 +150,7 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> { ...@@ -146,6 +150,7 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> {
/// end: Alignment.topRight, /// end: Alignment.topRight,
/// )); /// ));
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -123,7 +123,7 @@ enum AnimationBehavior { ...@@ -123,7 +123,7 @@ enum AnimationBehavior {
/// This can be used to write code such as the `fadeOutAndUpdateState` method /// This can be used to write code such as the `fadeOutAndUpdateState` method
/// below. /// below.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Here is a stateful [Foo] widget. Its [State] uses the /// Here is a stateful [Foo] widget. Its [State] uses the
/// [SingleTickerProviderStateMixin] to implement the necessary /// [SingleTickerProviderStateMixin] to implement the necessary
...@@ -172,6 +172,8 @@ enum AnimationBehavior { ...@@ -172,6 +172,8 @@ enum AnimationBehavior {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// The following method (for a [State] subclass) drives two animation /// The following method (for a [State] subclass) drives two animation
/// controllers using Dart's asynchronous syntax for awaiting [Future] objects: /// controllers using Dart's asynchronous syntax for awaiting [Future] objects:
...@@ -189,6 +191,7 @@ enum AnimationBehavior { ...@@ -189,6 +191,7 @@ enum AnimationBehavior {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// The assumption in the code above is that the animation controllers are being /// The assumption in the code above is that the animation controllers are being
/// disposed in the [State] subclass' override of the [State.dispose] method. /// disposed in the [State] subclass' override of the [State.dispose] method.
......
...@@ -328,7 +328,7 @@ class ReverseAnimation extends Animation<double> ...@@ -328,7 +328,7 @@ class ReverseAnimation extends Animation<double>
/// ///
/// If you want to apply a [Curve] to a [Tween], consider using [CurveTween]. /// If you want to apply a [Curve] to a [Tween], consider using [CurveTween].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following code snippet shows how you can apply a curve to a linear /// The following code snippet shows how you can apply a curve to a linear
/// animation produced by an [AnimationController] `controller`. /// animation produced by an [AnimationController] `controller`.
...@@ -339,6 +339,8 @@ class ReverseAnimation extends Animation<double> ...@@ -339,6 +339,8 @@ class ReverseAnimation extends Animation<double>
/// curve: Curves.ease, /// curve: Curves.ease,
/// ); /// );
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// This second code snippet shows how to apply a different curve in the forward /// This second code snippet shows how to apply a different curve in the forward
/// direction than in the reverse direction. This can't be done using a /// direction than in the reverse direction. This can't be done using a
...@@ -352,6 +354,7 @@ class ReverseAnimation extends Animation<double> ...@@ -352,6 +354,7 @@ class ReverseAnimation extends Animation<double>
/// reverseCurve: Curves.easeOut, /// reverseCurve: Curves.easeOut,
/// ); /// );
/// ``` /// ```
/// {@end-tool}
/// ///
/// By default, the [reverseCurve] matches the forward [curve]. /// By default, the [reverseCurve] matches the forward [curve].
/// ///
......
...@@ -128,7 +128,7 @@ class _ChainedEvaluation<T> extends Animatable<T> { ...@@ -128,7 +128,7 @@ class _ChainedEvaluation<T> extends Animatable<T> {
/// which results in two separate [Animation] objects, each configured with a /// which results in two separate [Animation] objects, each configured with a
/// single [Tween]. /// single [Tween].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Suppose `_controller` is an [AnimationController], and we want to create an /// Suppose `_controller` is an [AnimationController], and we want to create an
/// [Animation<Offset>] that is controlled by that controller, and save it in /// [Animation<Offset>] that is controlled by that controller, and save it in
...@@ -142,6 +142,8 @@ class _ChainedEvaluation<T> extends Animatable<T> { ...@@ -142,6 +142,8 @@ class _ChainedEvaluation<T> extends Animatable<T> {
/// ), /// ),
/// ); /// );
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// ```dart /// ```dart
/// _animation = Tween<Offset>( /// _animation = Tween<Offset>(
...@@ -149,6 +151,7 @@ class _ChainedEvaluation<T> extends Animatable<T> { ...@@ -149,6 +151,7 @@ class _ChainedEvaluation<T> extends Animatable<T> {
/// end: const Offset(200.0, 300.0), /// end: const Offset(200.0, 300.0),
/// ).animate(_controller); /// ).animate(_controller);
/// ``` /// ```
/// {@end-tool}
/// ///
/// In both cases, the `_animation` variable holds an object that, over the /// In both cases, the `_animation` variable holds an object that, over the
/// lifetime of the `_controller`'s animation, returns a value /// lifetime of the `_controller`'s animation, returns a value
...@@ -408,7 +411,7 @@ class ConstantTween<T> extends Tween<T> { ...@@ -408,7 +411,7 @@ class ConstantTween<T> extends Tween<T> {
/// curves when the animation is going forward vs when it is going backward, /// curves when the animation is going forward vs when it is going backward,
/// which can be useful in some scenarios.) /// which can be useful in some scenarios.)
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following code snippet shows how you can apply a curve to a linear /// The following code snippet shows how you can apply a curve to a linear
/// animation produced by an [AnimationController] `controller`: /// animation produced by an [AnimationController] `controller`:
...@@ -418,6 +421,7 @@ class ConstantTween<T> extends Tween<T> { ...@@ -418,6 +421,7 @@ class ConstantTween<T> extends Tween<T> {
/// CurveTween(curve: Curves.ease), /// CurveTween(curve: Curves.ease),
/// ); /// );
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -98,7 +98,7 @@ class TweenSequenceItem<T> { ...@@ -98,7 +98,7 @@ class TweenSequenceItem<T> {
/// animation's duration indicated by [weight] and this item's position /// animation's duration indicated by [weight] and this item's position
/// in the list of items. /// in the list of items.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The value of this item can be "curved" by chaining it to a [CurveTween]. /// The value of this item can be "curved" by chaining it to a [CurveTween].
/// For example to create a tween that eases from 0.0 to 10.0: /// For example to create a tween that eases from 0.0 to 10.0:
...@@ -107,6 +107,7 @@ class TweenSequenceItem<T> { ...@@ -107,6 +107,7 @@ class TweenSequenceItem<T> {
/// Tween<double>(begin: 0.0, end: 10.0) /// Tween<double>(begin: 0.0, end: 10.0)
/// .chain(CurveTween(curve: Curves.ease)) /// .chain(CurveTween(curve: Curves.ease))
/// ``` /// ```
/// {@end-tool}
final Animatable<T> tween; final Animatable<T> tween;
/// An abitrary value that indicates the relative percentage of a /// An abitrary value that indicates the relative percentage of a
......
...@@ -125,7 +125,7 @@ class CupertinoSegmentedControl<T> extends StatefulWidget { ...@@ -125,7 +125,7 @@ class CupertinoSegmentedControl<T> extends StatefulWidget {
/// the parent [StatefulWidget] using the [State.setState] method, so that /// the parent [StatefulWidget] using the [State.setState] method, so that
/// the parent gets rebuilt; for example: /// the parent gets rebuilt; for example:
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class SegmentedControlExample extends StatefulWidget { /// class SegmentedControlExample extends StatefulWidget {
...@@ -157,6 +157,7 @@ class CupertinoSegmentedControl<T> extends StatefulWidget { ...@@ -157,6 +157,7 @@ class CupertinoSegmentedControl<T> extends StatefulWidget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
final ValueChanged<T> onValueChanged; final ValueChanged<T> onValueChanged;
/// The color used to fill the backgrounds of unselected widgets and as the /// The color used to fill the backgrounds of unselected widgets and as the
......
...@@ -114,7 +114,7 @@ class CupertinoSlider extends StatefulWidget { ...@@ -114,7 +114,7 @@ class CupertinoSlider extends StatefulWidget {
/// The value passed will be the last [value] that the slider had before the /// The value passed will be the last [value] that the slider had before the
/// change began. /// change began.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// CupertinoSlider( /// CupertinoSlider(
...@@ -132,6 +132,7 @@ class CupertinoSlider extends StatefulWidget { ...@@ -132,6 +132,7 @@ class CupertinoSlider extends StatefulWidget {
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -145,7 +146,7 @@ class CupertinoSlider extends StatefulWidget { ...@@ -145,7 +146,7 @@ class CupertinoSlider extends StatefulWidget {
/// [onChanged] for that), but rather to know when the user has completed /// [onChanged] for that), but rather to know when the user has completed
/// selecting a new [value] by ending a drag. /// selecting a new [value] by ending a drag.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// CupertinoSlider( /// CupertinoSlider(
...@@ -163,6 +164,7 @@ class CupertinoSlider extends StatefulWidget { ...@@ -163,6 +164,7 @@ class CupertinoSlider extends StatefulWidget {
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -26,7 +26,7 @@ import 'thumb_painter.dart'; ...@@ -26,7 +26,7 @@ import 'thumb_painter.dart';
/// that use a switch will listen for the [onChanged] callback and rebuild the /// that use a switch will listen for the [onChanged] callback and rebuild the
/// switch with a new [value] to update the visual appearance of the switch. /// switch with a new [value] to update the visual appearance of the switch.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample shows how to use a [CupertinoSwitch] in a [ListTile]. The /// This sample shows how to use a [CupertinoSwitch] in a [ListTile]. The
/// [MergeSemantics] is used to turn the entire [ListTile] into a single item /// [MergeSemantics] is used to turn the entire [ListTile] into a single item
...@@ -44,6 +44,7 @@ import 'thumb_painter.dart'; ...@@ -44,6 +44,7 @@ import 'thumb_painter.dart';
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -22,7 +22,7 @@ import 'bottom_tab_bar.dart'; ...@@ -22,7 +22,7 @@ import 'bottom_tab_bar.dart';
/// Use [CupertinoTabView] as the content of each tab to support tabs with parallel /// Use [CupertinoTabView] as the content of each tab to support tabs with parallel
/// navigation state and history. /// navigation state and history.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// A sample code implementing a typical iOS information architecture with tabs. /// A sample code implementing a typical iOS information architecture with tabs.
/// ///
...@@ -70,6 +70,7 @@ import 'bottom_tab_bar.dart'; ...@@ -70,6 +70,7 @@ import 'bottom_tab_bar.dart';
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// To push a route above all tabs instead of inside the currently selected one /// To push a route above all tabs instead of inside the currently selected one
/// (such as when showing a dialog on top of this scaffold), use /// (such as when showing a dialog on top of this scaffold), use
......
...@@ -85,7 +85,7 @@ enum OverlayVisibilityMode { ...@@ -85,7 +85,7 @@ enum OverlayVisibilityMode {
/// [controller]. For example, to set the initial value of the text field, use /// [controller]. For example, to set the initial value of the text field, use
/// a [controller] that already contains some text such as: /// a [controller] that already contains some text such as:
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class MyPrefilledText extends StatefulWidget { /// class MyPrefilledText extends StatefulWidget {
...@@ -108,6 +108,7 @@ enum OverlayVisibilityMode { ...@@ -108,6 +108,7 @@ enum OverlayVisibilityMode {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// The [controller] can also control the selection and composing region (and to /// The [controller] can also control the selection and composing region (and to
/// observe changes to the text, selection, and composing region). /// observe changes to the text, selection, and composing region).
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/// ///
/// A class can have multiple categories. /// A class can have multiple categories.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// /// A copper coffee pot, as desired by Ben Turpin. /// /// A copper coffee pot, as desired by Ben Turpin.
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
/// // ...code... /// // ...code...
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -53,7 +54,7 @@ class Category { ...@@ -53,7 +54,7 @@ class Category {
/// ///
/// Each class should only have one [DocumentationIcon]. /// Each class should only have one [DocumentationIcon].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// /// Utility class for beginning a dream-sharing sequence. /// /// Utility class for beginning a dream-sharing sequence.
...@@ -64,6 +65,7 @@ class Category { ...@@ -64,6 +65,7 @@ class Category {
/// // ...code... /// // ...code...
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -85,7 +87,7 @@ class DocumentationIcon { ...@@ -85,7 +87,7 @@ class DocumentationIcon {
/// for this purpose, but on occasion the first paragraph is either too short /// for this purpose, but on occasion the first paragraph is either too short
/// or too long for use in isolation, without the remainder of the documentation. /// or too long for use in isolation, without the remainder of the documentation.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// /// A famous cat. /// /// A famous cat.
...@@ -100,6 +102,7 @@ class DocumentationIcon { ...@@ -100,6 +102,7 @@ class DocumentationIcon {
/// // ...code... /// // ...code...
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -1012,7 +1012,7 @@ abstract class DiagnosticsNode { ...@@ -1012,7 +1012,7 @@ abstract class DiagnosticsNode {
/// Debugging message displayed like a property. /// Debugging message displayed like a property.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following two properties are better expressed using this /// The following two properties are better expressed using this
/// [MessageProperty] class, rather than [StringProperty], as the intent is to /// [MessageProperty] class, rather than [StringProperty], as the intent is to
...@@ -1020,18 +1020,19 @@ abstract class DiagnosticsNode { ...@@ -1020,18 +1020,19 @@ abstract class DiagnosticsNode {
/// of an actual property of the object: /// of an actual property of the object:
/// ///
/// ```dart /// ```dart
/// MessageProperty('table size', '$columns\u00D7$rows') /// var table = MessageProperty('table size', '$columns\u00D7$rows');
/// ``` /// var usefulness = MessageProperty('usefulness ratio', 'no metrics collected yet (never painted)');
/// ```dart
/// MessageProperty('usefulness ratio', 'no metrics collected yet (never painted)')
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// On the other hand, [StringProperty] is better suited when the property has a /// On the other hand, [StringProperty] is better suited when the property has a
/// concrete value that is a string: /// concrete value that is a string:
/// ///
/// ```dart /// ```dart
/// StringProperty('name', _name) /// var name = StringProperty('name', _name);
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -1324,7 +1325,7 @@ class PercentProperty extends DoubleProperty { ...@@ -1324,7 +1325,7 @@ class PercentProperty extends DoubleProperty {
/// when `visible` is false and nothing when visible is true, in contrast to /// when `visible` is false and nothing when visible is true, in contrast to
/// `visible: true` or `visible: false`. /// `visible: true` or `visible: false`.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// FlagProperty( /// FlagProperty(
...@@ -1333,6 +1334,8 @@ class PercentProperty extends DoubleProperty { ...@@ -1333,6 +1334,8 @@ class PercentProperty extends DoubleProperty {
/// ifFalse: 'hidden', /// ifFalse: 'hidden',
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// [FlagProperty] should also be used instead of [DiagnosticsProperty<bool>] /// [FlagProperty] should also be used instead of [DiagnosticsProperty<bool>]
/// if showing the bool value would not clearly indicate the meaning of the /// if showing the bool value would not clearly indicate the meaning of the
...@@ -1346,6 +1349,7 @@ class PercentProperty extends DoubleProperty { ...@@ -1346,6 +1349,7 @@ class PercentProperty extends DoubleProperty {
/// ifFalse: '<no style specified>', /// ifFalse: '<no style specified>',
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -2044,7 +2048,7 @@ String describeIdentity(Object object) => '${object.runtimeType}#${shortHash(obj ...@@ -2044,7 +2048,7 @@ String describeIdentity(Object object) => '${object.runtimeType}#${shortHash(obj
/// ///
/// Strips off the enum class name from the `enumEntry.toString()`. /// Strips off the enum class name from the `enumEntry.toString()`.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// enum Day { /// enum Day {
...@@ -2056,6 +2060,7 @@ String describeIdentity(Object object) => '${object.runtimeType}#${shortHash(obj ...@@ -2056,6 +2060,7 @@ String describeIdentity(Object object) => '${object.runtimeType}#${shortHash(obj
/// assert(describeEnum(Day.monday) == 'monday'); /// assert(describeEnum(Day.monday) == 'monday');
/// } /// }
/// ``` /// ```
/// {@end-tool}
String describeEnum(Object enumEntry) { String describeEnum(Object enumEntry) {
final String description = enumEntry.toString(); final String description = enumEntry.toString();
final int indexOfDot = description.indexOf('.'); final int indexOfDot = description.indexOf('.');
...@@ -2214,7 +2219,7 @@ abstract class Diagnosticable { ...@@ -2214,7 +2219,7 @@ abstract class Diagnosticable {
/// `toString` method implementation works fine using [DiagnosticsProperty] /// `toString` method implementation works fine using [DiagnosticsProperty]
/// directly. /// directly.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows best practices for implementing [debugFillProperties] /// This example shows best practices for implementing [debugFillProperties]
/// illustrating use of all common [DiagnosticsProperty] subclasses and all /// illustrating use of all common [DiagnosticsProperty] subclasses and all
...@@ -2343,6 +2348,7 @@ abstract class Diagnosticable { ...@@ -2343,6 +2348,7 @@ abstract class Diagnosticable {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// Used by [toDiagnosticsNode] and [toString]. /// Used by [toDiagnosticsNode] and [toString].
@protected @protected
......
...@@ -63,7 +63,7 @@ enum _LicenseEntryWithLineBreaksParserState { ...@@ -63,7 +63,7 @@ enum _LicenseEntryWithLineBreaksParserState {
/// unless they start with the same number of spaces as the previous line, in /// unless they start with the same number of spaces as the previous line, in
/// which case it's assumed they are a continuation of an indented paragraph. /// which case it's assumed they are a continuation of an indented paragraph.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// For example, the BSD license in this format could be encoded as follows: /// For example, the BSD license in this format could be encoded as follows:
/// ///
...@@ -101,6 +101,7 @@ enum _LicenseEntryWithLineBreaksParserState { ...@@ -101,6 +101,7 @@ enum _LicenseEntryWithLineBreaksParserState {
/// }); /// });
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// This would result in a license with six [paragraphs], the third, fourth, and /// This would result in a license with six [paragraphs], the third, fourth, and
/// fifth being indented one level. /// fifth being indented one level.
......
...@@ -16,7 +16,7 @@ part of material_animated_icons; ...@@ -16,7 +16,7 @@ part of material_animated_icons;
/// ///
/// The available icons are specified in [AnimatedIcons]. /// The available icons are specified in [AnimatedIcons].
/// ///
/// ### Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// AnimatedIcon( /// AnimatedIcon(
...@@ -25,6 +25,7 @@ part of material_animated_icons; ...@@ -25,6 +25,7 @@ part of material_animated_icons;
/// semanticLabel: 'Show menu', /// semanticLabel: 'Show menu',
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
class AnimatedIcon extends StatelessWidget { class AnimatedIcon extends StatelessWidget {
......
...@@ -89,7 +89,7 @@ class _ToolbarContainerLayout extends SingleChildLayoutDelegate { ...@@ -89,7 +89,7 @@ class _ToolbarContainerLayout extends SingleChildLayoutDelegate {
/// to false. In that case a null leading widget will result in the middle/title widget /// to false. In that case a null leading widget will result in the middle/title widget
/// stretching to start. /// stretching to start.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// AppBar( /// AppBar(
...@@ -113,6 +113,7 @@ class _ToolbarContainerLayout extends SingleChildLayoutDelegate { ...@@ -113,6 +113,7 @@ class _ToolbarContainerLayout extends SingleChildLayoutDelegate {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -169,7 +170,7 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { ...@@ -169,7 +170,7 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
/// there's no [Drawer] and the parent [Navigator] can go back, the [AppBar] /// there's no [Drawer] and the parent [Navigator] can go back, the [AppBar]
/// will use a [BackButton] that calls [Navigator.maybePop]. /// will use a [BackButton] that calls [Navigator.maybePop].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following code shows how the drawer button could be manually specified /// The following code shows how the drawer button could be manually specified
/// instead of relying on [automaticallyImplyLeading]: /// instead of relying on [automaticallyImplyLeading]:
...@@ -187,6 +188,7 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { ...@@ -187,6 +188,7 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// The [Builder] is used in this example to ensure that the `context` refers /// The [Builder] is used in this example to ensure that the `context` refers
/// to that part of the subtree. That way this code snippet can be used even /// to that part of the subtree. That way this code snippet can be used even
...@@ -237,7 +239,7 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { ...@@ -237,7 +239,7 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
/// ), /// ),
/// ], /// ],
/// ), /// ),
/// ); /// )
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
final List<Widget> actions; final List<Widget> actions;
...@@ -722,7 +724,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { ...@@ -722,7 +724,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
/// [actions], above the [bottom] (if any). If a [flexibleSpace] widget is /// [actions], above the [bottom] (if any). If a [flexibleSpace] widget is
/// specified then it is stacked behind the toolbar and the bottom widget. /// specified then it is stacked behind the toolbar and the bottom widget.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This is an example that could be included in a [CustomScrollView]'s /// This is an example that could be included in a [CustomScrollView]'s
/// [CustomScrollView.slivers] list: /// [CustomScrollView.slivers] list:
...@@ -742,6 +744,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { ...@@ -742,6 +744,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
/// ] /// ]
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -820,7 +823,7 @@ class SliverAppBar extends StatefulWidget { ...@@ -820,7 +823,7 @@ class SliverAppBar extends StatefulWidget {
/// For less common operations, consider using a [PopupMenuButton] as the /// For less common operations, consider using a [PopupMenuButton] as the
/// last action. /// last action.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Scaffold( /// Scaffold(
...@@ -844,6 +847,7 @@ class SliverAppBar extends StatefulWidget { ...@@ -844,6 +847,7 @@ class SliverAppBar extends StatefulWidget {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
final List<Widget> actions; final List<Widget> actions;
/// This widget is stacked behind the toolbar and the tabbar. It's height will /// This widget is stacked behind the toolbar and the tabbar. It's height will
......
...@@ -19,8 +19,7 @@ import 'theme.dart'; ...@@ -19,8 +19,7 @@ import 'theme.dart';
/// ///
/// Typically used with a [Scaffold] and a [FloatingActionButton]. /// Typically used with a [Scaffold] and a [FloatingActionButton].
/// ///
/// ## Sample code /// {@tool sample}
///
/// ```dart /// ```dart
/// Scaffold( /// Scaffold(
/// bottomNavigationBar: BottomAppBar( /// bottomNavigationBar: BottomAppBar(
...@@ -30,6 +29,7 @@ import 'theme.dart'; ...@@ -30,6 +29,7 @@ import 'theme.dart';
/// floatingActionButton: FloatingActionButton(onPressed: null), /// floatingActionButton: FloatingActionButton(onPressed: null),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -12,13 +12,20 @@ import 'theme.dart'; ...@@ -12,13 +12,20 @@ import 'theme.dart';
/// A card is a sheet of [Material] used to represent some related information, /// A card is a sheet of [Material] used to represent some related information,
/// for example an album, a geographical location, a meal, contact details, etc. /// for example an album, a geographical location, a meal, contact details, etc.
/// ///
/// This is what it looks like when run:
///
/// ![A card with a slight shadow, consisting of two rows, one with an icon and
/// 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 snippet --template=stateless_widget} /// {@tool snippet --template=stateless_widget}
/// ///
/// This sample shows creation of a [Card] widget that shows album information /// This sample shows creation of a [Card] widget that shows album information
/// and two actions. /// and two actions.
/// ///
/// ```dart /// ```dart
/// Card( /// Center(
/// child: Card(
/// child: Column( /// child: Column(
/// mainAxisSize: MainAxisSize.min, /// mainAxisSize: MainAxisSize.min,
/// children: <Widget>[ /// children: <Widget>[
...@@ -43,16 +50,11 @@ import 'theme.dart'; ...@@ -43,16 +50,11 @@ import 'theme.dart';
/// ), /// ),
/// ], /// ],
/// ), /// ),
/// ); /// ),
/// )
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
/// ///
/// This is what it looks like when run:
///
/// ![A card with a slight shadow, consisting of two rows, one with an icon and
/// 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)
///
/// See also: /// See also:
/// ///
/// * [ListTile], to display icons and text in a card. /// * [ListTile], to display icons and text in a card.
......
...@@ -37,11 +37,14 @@ import 'theme_data.dart'; ...@@ -37,11 +37,14 @@ import 'theme_data.dart';
/// To show the [CheckboxListTile] as disabled, pass null as the [onChanged] /// To show the [CheckboxListTile] as disabled, pass null as the [onChanged]
/// callback. /// callback.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This widget shows a checkbox that, when checked, slows down all animations /// This widget shows a checkbox that, when checked, slows down all animations
/// (including the animation of the checkbox itself getting checked!). /// (including the animation of the checkbox itself getting checked!).
/// ///
/// This sample requires that you also import 'package:flutter/scheduler.dart',
/// so that you can reference [timeDilation].
///
/// ```dart /// ```dart
/// CheckboxListTile( /// CheckboxListTile(
/// title: const Text('Animate Slowly'), /// title: const Text('Animate Slowly'),
...@@ -52,9 +55,7 @@ import 'theme_data.dart'; ...@@ -52,9 +55,7 @@ import 'theme_data.dart';
/// secondary: const Icon(Icons.hourglass_empty), /// secondary: const Icon(Icons.hourglass_empty),
/// ) /// )
/// ``` /// ```
/// /// {@end-tool}
/// This sample requires that you also import 'package:flutter/scheduler.dart',
/// so that you can reference [timeDilation].
/// ///
/// See also: /// See also:
/// ///
......
...@@ -377,7 +377,7 @@ abstract class TappableChipAttributes { ...@@ -377,7 +377,7 @@ abstract class TappableChipAttributes {
/// taps on the label or avatar parts of the chip. If [onPressed] is null, /// taps on the label or avatar parts of the chip. If [onPressed] is null,
/// then the chip will be disabled. /// then the chip will be disabled.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class Blacksmith extends StatelessWidget { /// class Blacksmith extends StatelessWidget {
...@@ -394,6 +394,7 @@ abstract class TappableChipAttributes { ...@@ -394,6 +394,7 @@ abstract class TappableChipAttributes {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
VoidCallback get onPressed; VoidCallback get onPressed;
/// Elevation to be applied on the chip during the press motion. /// Elevation to be applied on the chip during the press motion.
...@@ -418,7 +419,7 @@ abstract class TappableChipAttributes { ...@@ -418,7 +419,7 @@ abstract class TappableChipAttributes {
/// Requires one of its ancestors to be a [Material] widget. The [label] /// Requires one of its ancestors to be a [Material] widget. The [label]
/// and [clipBehavior] arguments must not be null. /// and [clipBehavior] arguments must not be null.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Chip( /// Chip(
...@@ -429,6 +430,7 @@ abstract class TappableChipAttributes { ...@@ -429,6 +430,7 @@ abstract class TappableChipAttributes {
/// label: Text('Aaron Burr'), /// label: Text('Aaron Burr'),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -534,7 +536,7 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri ...@@ -534,7 +536,7 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri
/// * In a horizontally scrollable list, like a [ListView] whose /// * In a horizontally scrollable list, like a [ListView] whose
/// scrollDirection is [Axis.horizontal]. /// scrollDirection is [Axis.horizontal].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// InputChip( /// InputChip(
...@@ -548,6 +550,7 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri ...@@ -548,6 +550,7 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri
/// } /// }
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -684,7 +687,7 @@ class InputChip extends StatelessWidget ...@@ -684,7 +687,7 @@ class InputChip extends StatelessWidget
/// Requires one of its ancestors to be a [Material] widget. The [selected] and /// Requires one of its ancestors to be a [Material] widget. The [selected] and
/// [label] arguments must not be null. /// [label] arguments must not be null.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class MyThreeOptions extends StatefulWidget { /// class MyThreeOptions extends StatefulWidget {
...@@ -716,6 +719,7 @@ class InputChip extends StatelessWidget ...@@ -716,6 +719,7 @@ class InputChip extends StatelessWidget
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -830,7 +834,7 @@ class ChoiceChip extends StatelessWidget ...@@ -830,7 +834,7 @@ class ChoiceChip extends StatelessWidget
/// ///
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class ActorFilterEntry { /// class ActorFilterEntry {
...@@ -891,6 +895,7 @@ class ChoiceChip extends StatelessWidget ...@@ -891,6 +895,7 @@ class ChoiceChip extends StatelessWidget
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -1012,7 +1017,7 @@ class FilterChip extends StatelessWidget ...@@ -1012,7 +1017,7 @@ class FilterChip extends StatelessWidget
/// ///
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// ActionChip( /// ActionChip(
...@@ -1026,6 +1031,7 @@ class FilterChip extends StatelessWidget ...@@ -1026,6 +1031,7 @@ class FilterChip extends StatelessWidget
/// } /// }
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -60,7 +60,7 @@ class ChipTheme extends InheritedWidget { ...@@ -60,7 +60,7 @@ class ChipTheme extends InheritedWidget {
/// Defaults to the ambient [ThemeData.chipTheme] if there is no /// Defaults to the ambient [ThemeData.chipTheme] if there is no
/// [ChipTheme] in the given build context. /// [ChipTheme] in the given build context.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class Spaceship extends StatelessWidget { /// class Spaceship extends StatelessWidget {
...@@ -76,6 +76,7 @@ class ChipTheme extends InheritedWidget { ...@@ -76,6 +76,7 @@ class ChipTheme extends InheritedWidget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -111,7 +112,7 @@ class ChipTheme extends InheritedWidget { ...@@ -111,7 +112,7 @@ class ChipTheme extends InheritedWidget {
/// you get from [ChipTheme.of], or create an entirely new one with /// you get from [ChipTheme.of], or create an entirely new one with
/// [ChipThemeData..fromDefaults]. /// [ChipThemeData..fromDefaults].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class CarColor extends StatefulWidget { /// class CarColor extends StatefulWidget {
...@@ -139,6 +140,7 @@ class ChipTheme extends InheritedWidget { ...@@ -139,6 +140,7 @@ class ChipTheme extends InheritedWidget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -17,7 +17,7 @@ import 'theme_data.dart'; ...@@ -17,7 +17,7 @@ import 'theme_data.dart';
/// such an image, the user's initials. A given user's initials should /// such an image, the user's initials. A given user's initials should
/// always be paired with the same background color, for consistency. /// always be paired with the same background color, for consistency.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// If the avatar is to have an image, the image should be specified in the /// If the avatar is to have an image, the image should be specified in the
/// [backgroundImage] property: /// [backgroundImage] property:
...@@ -27,9 +27,12 @@ import 'theme_data.dart'; ...@@ -27,9 +27,12 @@ import 'theme_data.dart';
/// backgroundImage: NetworkImage(userAvatarUrl), /// backgroundImage: NetworkImage(userAvatarUrl),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// The image will be cropped to have a circle shape. /// The image will be cropped to have a circle shape.
/// ///
/// {@tool sample}
///
/// If the avatar is to just have the user's initials, they are typically /// If the avatar is to just have the user's initials, they are typically
/// provided using a [Text] widget as the [child] and a [backgroundColor]: /// provided using a [Text] widget as the [child] and a [backgroundColor]:
/// ///
...@@ -39,6 +42,7 @@ import 'theme_data.dart'; ...@@ -39,6 +42,7 @@ import 'theme_data.dart';
/// child: Text('AH'), /// child: Text('AH'),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -133,7 +133,7 @@ class Dialog extends StatelessWidget { ...@@ -133,7 +133,7 @@ class Dialog extends StatelessWidget {
/// Typically passed as the child widget to [showDialog], which displays the /// Typically passed as the child widget to [showDialog], which displays the
/// dialog. /// dialog.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This snippet shows a method in a [State] which, when called, displays a dialog box /// This snippet shows a method in a [State] which, when called, displays a dialog box
/// and returns a [Future] that completes when the dialog is dismissed. /// and returns a [Future] that completes when the dialog is dismissed.
...@@ -167,6 +167,7 @@ class Dialog extends StatelessWidget { ...@@ -167,6 +167,7 @@ class Dialog extends StatelessWidget {
/// ); /// );
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -334,7 +335,7 @@ class AlertDialog extends StatelessWidget { ...@@ -334,7 +335,7 @@ class AlertDialog extends StatelessWidget {
/// title and the first option, and 24 pixels of spacing between the last option /// title and the first option, and 24 pixels of spacing between the last option
/// and the bottom of the dialog. /// and the bottom of the dialog.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// SimpleDialogOption( /// SimpleDialogOption(
...@@ -342,6 +343,7 @@ class AlertDialog extends StatelessWidget { ...@@ -342,6 +343,7 @@ class AlertDialog extends StatelessWidget {
/// child: const Text('Treasury department'), /// child: const Text('Treasury department'),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -398,7 +400,7 @@ class SimpleDialogOption extends StatelessWidget { ...@@ -398,7 +400,7 @@ class SimpleDialogOption extends StatelessWidget {
/// Typically passed as the child widget to [showDialog], which displays the /// Typically passed as the child widget to [showDialog], which displays the
/// dialog. /// dialog.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// In this example, the user is asked to select between two options. These /// In this example, the user is asked to select between two options. These
/// options are represented as an enum. The [showDialog] method here returns /// options are represented as an enum. The [showDialog] method here returns
...@@ -441,6 +443,7 @@ class SimpleDialogOption extends StatelessWidget { ...@@ -441,6 +443,7 @@ class SimpleDialogOption extends StatelessWidget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -58,13 +58,14 @@ class Divider extends StatelessWidget { ...@@ -58,13 +58,14 @@ class Divider extends StatelessWidget {
/// Defaults to the current theme's divider color, given by /// Defaults to the current theme's divider color, given by
/// [ThemeData.dividerColor]. /// [ThemeData.dividerColor].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Divider( /// Divider(
/// color: Colors.deepOrange, /// color: Colors.deepOrange,
/// ) /// )
/// ``` /// ```
/// {@end-tool}
final Color color; final Color color;
/// Computes the [BorderSide] that represents a divider of the specified /// Computes the [BorderSide] that represents a divider of the specified
...@@ -74,7 +75,7 @@ class Divider extends StatelessWidget { ...@@ -74,7 +75,7 @@ class Divider extends StatelessWidget {
/// The `width` argument can be used to override the default width of the /// The `width` argument can be used to override the default width of the
/// divider border, which is usually 0.0 (a hairline border). /// divider border, which is usually 0.0 (a hairline border).
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example uses this method to create a box that has a divider above and /// This example uses this method to create a box that has a divider above and
/// below it. This is sometimes useful with lists, for instance, to separate a /// below it. This is sometimes useful with lists, for instance, to separate a
...@@ -91,6 +92,7 @@ class Divider extends StatelessWidget { ...@@ -91,6 +92,7 @@ class Divider extends StatelessWidget {
/// // child: ... /// // child: ...
/// ) /// )
/// ``` /// ```
/// {@end-tool}
static BorderSide createBorderSide(BuildContext context, { Color color, double width = 0.0 }) { static BorderSide createBorderSide(BuildContext context, { Color color, double width = 0.0 }) {
assert(width != null); assert(width != null);
return BorderSide( return BorderSide(
...@@ -164,13 +166,14 @@ class VerticalDivider extends StatelessWidget { ...@@ -164,13 +166,14 @@ class VerticalDivider extends StatelessWidget {
/// Defaults to the current theme's divider color, given by /// Defaults to the current theme's divider color, given by
/// [ThemeData.dividerColor]. /// [ThemeData.dividerColor].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Divider( /// Divider(
/// color: Colors.deepOrange, /// color: Colors.deepOrange,
/// ) /// )
/// ``` /// ```
/// {@end-tool}
final Color color; final Color color;
@override @override
......
...@@ -28,7 +28,7 @@ import 'theme.dart'; ...@@ -28,7 +28,7 @@ import 'theme.dart';
/// [StatelessWidget.build] method or from a [State]'s methods as you have to /// [StatelessWidget.build] method or from a [State]'s methods as you have to
/// provide a [BuildContext]. /// provide a [BuildContext].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// To trigger platform-specific feedback before executing the actual callback: /// To trigger platform-specific feedback before executing the actual callback:
/// ///
...@@ -52,6 +52,8 @@ import 'theme.dart'; ...@@ -52,6 +52,8 @@ import 'theme.dart';
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// Alternatively, you can also call [forTap] or [forLongPress] directly within /// Alternatively, you can also call [forTap] or [forLongPress] directly within
/// your tap or long press handler: /// your tap or long press handler:
...@@ -76,6 +78,7 @@ import 'theme.dart'; ...@@ -76,6 +78,7 @@ import 'theme.dart';
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
class Feedback { class Feedback {
Feedback._(); Feedback._();
......
...@@ -44,7 +44,7 @@ import 'material.dart'; ...@@ -44,7 +44,7 @@ import 'material.dart';
/// generally speaking will match the order they are given in the widget tree, /// generally speaking will match the order they are given in the widget tree,
/// but this order may appear to be somewhat random in more dynamic situations. /// but this order may appear to be somewhat random in more dynamic situations.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows how a [Material] widget can have a yellow rectangle drawn /// This example shows how a [Material] widget can have a yellow rectangle drawn
/// on it using [Ink], while still having ink effects over the yellow rectangle: /// on it using [Ink], while still having ink effects over the yellow rectangle:
...@@ -67,6 +67,8 @@ import 'material.dart'; ...@@ -67,6 +67,8 @@ import 'material.dart';
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// The following example shows how an image can be printed on a [Material] /// The following example shows how an image can be printed on a [Material]
/// widget with an [InkWell] above it: /// widget with an [InkWell] above it:
...@@ -94,6 +96,7 @@ import 'material.dart'; ...@@ -94,6 +96,7 @@ import 'material.dart';
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -170,7 +170,7 @@ enum ListTileControlAffinity { ...@@ -170,7 +170,7 @@ enum ListTileControlAffinity {
/// ///
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Here is a simple tile with an icon and some text. /// Here is a simple tile with an icon and some text.
/// ///
...@@ -180,6 +180,8 @@ enum ListTileControlAffinity { ...@@ -180,6 +180,8 @@ enum ListTileControlAffinity {
/// title: const Text('The seat for the narrator'), /// title: const Text('The seat for the narrator'),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// Tiles can be much more elaborate. Here is a tile which can be tapped, but /// Tiles can be much more elaborate. Here is a tile which can be tapped, but
/// which is disabled when the `_act` variable is not 2. When the tile is /// which is disabled when the `_act` variable is not 2. When the tile is
...@@ -196,6 +198,7 @@ enum ListTileControlAffinity { ...@@ -196,6 +198,7 @@ enum ListTileControlAffinity {
/// onTap: () { /* react to the tile being tapped */ } /// onTap: () { /* react to the tile being tapped */ }
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -135,7 +135,7 @@ class _PopupMenuDividerState extends State<PopupMenuDivider> { ...@@ -135,7 +135,7 @@ class _PopupMenuDividerState extends State<PopupMenuDivider> {
/// [PopupMenuItem] is 48 pixels high. If you use a widget with a different /// [PopupMenuItem] is 48 pixels high. If you use a widget with a different
/// height, it must be specified in the [height] property. /// height, it must be specified in the [height] property.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Here, a [Text] widget is used with a popup menu item. The `WhyFarther` type /// Here, a [Text] widget is used with a popup menu item. The `WhyFarther` type
/// is an enum, not shown here. /// is an enum, not shown here.
...@@ -146,6 +146,7 @@ class _PopupMenuDividerState extends State<PopupMenuDivider> { ...@@ -146,6 +146,7 @@ class _PopupMenuDividerState extends State<PopupMenuDivider> {
/// child: Text('Working a lot harder'), /// child: Text('Working a lot harder'),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See the example at [PopupMenuButton] for how this example could be used in a /// See the example at [PopupMenuButton] for how this example could be used in a
/// complete menu, and see the example at [CheckedPopupMenuItem] for one way to /// complete menu, and see the example at [CheckedPopupMenuItem] for one way to
...@@ -286,7 +287,7 @@ class PopupMenuItemState<T, W extends PopupMenuItem<T>> extends State<W> { ...@@ -286,7 +287,7 @@ class PopupMenuItemState<T, W extends PopupMenuItem<T>> extends State<W> {
/// of a [PopupMenuItem]. The horizontal layout uses a [ListTile]; the checkmark /// of a [PopupMenuItem]. The horizontal layout uses a [ListTile]; the checkmark
/// is an [Icons.done] icon, shown in the [ListTile.leading] position. /// is an [Icons.done] icon, shown in the [ListTile.leading] position.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Suppose a `Commands` enum exists that lists the possible commands from a /// Suppose a `Commands` enum exists that lists the possible commands from a
/// particular popup menu, including `Commands.heroAndScholar` and /// particular popup menu, including `Commands.heroAndScholar` and
...@@ -324,6 +325,7 @@ class PopupMenuItemState<T, W extends PopupMenuItem<T>> extends State<W> { ...@@ -324,6 +325,7 @@ class PopupMenuItemState<T, W extends PopupMenuItem<T>> extends State<W> {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// In particular, observe how the second menu item uses a [ListTile] with a /// In particular, observe how the second menu item uses a [ListTile] with a
/// blank [Icon] in the [ListTile.leading] position to get the same alignment as /// blank [Icon] in the [ListTile.leading] position to get the same alignment as
...@@ -770,7 +772,7 @@ typedef PopupMenuItemBuilder<T> = List<PopupMenuEntry<T>> Function(BuildContext ...@@ -770,7 +772,7 @@ typedef PopupMenuItemBuilder<T> = List<PopupMenuEntry<T>> Function(BuildContext
/// If both are null, then a standard overflow icon is created (depending on the /// If both are null, then a standard overflow icon is created (depending on the
/// platform). /// platform).
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows a menu with four items, selecting between an enum's /// This example shows a menu with four items, selecting between an enum's
/// values and setting a `_selection` field based on the selection. /// values and setting a `_selection` field based on the selection.
...@@ -803,6 +805,7 @@ typedef PopupMenuItemBuilder<T> = List<PopupMenuEntry<T>> Function(BuildContext ...@@ -803,6 +805,7 @@ typedef PopupMenuItemBuilder<T> = List<PopupMenuEntry<T>> Function(BuildContext
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -40,7 +40,7 @@ import 'theme_data.dart'; ...@@ -40,7 +40,7 @@ import 'theme_data.dart';
/// To show the [RadioListTile] as disabled, pass null as the [onChanged] /// To show the [RadioListTile] as disabled, pass null as the [onChanged]
/// callback. /// callback.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This widget shows a pair of radio buttons that control the `_character` /// This widget shows a pair of radio buttons that control the `_character`
/// field. The field is of the type `SingingCharacter`, an enum. /// field. The field is of the type `SingingCharacter`, an enum.
...@@ -70,6 +70,7 @@ import 'theme_data.dart'; ...@@ -70,6 +70,7 @@ import 'theme_data.dart';
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -25,9 +25,7 @@ import 'material_localizations.dart'; ...@@ -25,9 +25,7 @@ import 'material_localizations.dart';
/// [ReorderableListView] will need to account for this when inserting before /// [ReorderableListView] will need to account for this when inserting before
/// [newIndex]. /// [newIndex].
/// ///
/// ## Sample code /// {@tool sample}
///
/// Example implementation:
/// ///
/// ```dart /// ```dart
/// final List<MyDataObject> backingList = <MyDataObject>[/* ... */]; /// final List<MyDataObject> backingList = <MyDataObject>[/* ... */];
...@@ -41,6 +39,7 @@ import 'material_localizations.dart'; ...@@ -41,6 +39,7 @@ import 'material_localizations.dart';
/// backingList.insert(newIndex, element); /// backingList.insert(newIndex, element);
/// } /// }
/// ``` /// ```
/// {@end-tool}
typedef ReorderCallback = void Function(int oldIndex, int newIndex); typedef ReorderCallback = void Function(int oldIndex, int newIndex);
/// A list whose items the user can interactively reorder by dragging. /// A list whose items the user can interactively reorder by dragging.
......
...@@ -657,7 +657,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr ...@@ -657,7 +657,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// [ScaffoldState] for the current [BuildContext] via [Scaffold.of] and use the /// [ScaffoldState] for the current [BuildContext] via [Scaffold.of] and use the
/// [ScaffoldState.showSnackBar] and [ScaffoldState.showBottomSheet] functions. /// [ScaffoldState.showSnackBar] and [ScaffoldState.showBottomSheet] functions.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows a [Scaffold] with an [AppBar], a [BottomAppBar] /// This example shows a [Scaffold] with an [AppBar], a [BottomAppBar]
/// and a [FloatingActionButton]. The [body] is a [Text] placed in a [Center] /// and a [FloatingActionButton]. The [body] is a [Text] placed in a [Center]
...@@ -684,6 +684,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr ...@@ -684,6 +684,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, /// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -146,7 +146,7 @@ class Slider extends StatefulWidget { ...@@ -146,7 +146,7 @@ class Slider extends StatefulWidget {
/// [StatefulWidget] using the [State.setState] method, so that the parent /// [StatefulWidget] using the [State.setState] method, so that the parent
/// gets rebuilt; for example: /// gets rebuilt; for example:
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Slider( /// Slider(
...@@ -162,6 +162,7 @@ class Slider extends StatefulWidget { ...@@ -162,6 +162,7 @@ class Slider extends StatefulWidget {
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -180,7 +181,7 @@ class Slider extends StatefulWidget { ...@@ -180,7 +181,7 @@ class Slider extends StatefulWidget {
/// The value passed will be the last [value] that the slider had before the /// The value passed will be the last [value] that the slider had before the
/// change began. /// change began.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Slider( /// Slider(
...@@ -199,6 +200,7 @@ class Slider extends StatefulWidget { ...@@ -199,6 +200,7 @@ class Slider extends StatefulWidget {
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -212,7 +214,7 @@ class Slider extends StatefulWidget { ...@@ -212,7 +214,7 @@ class Slider extends StatefulWidget {
/// [onChanged] for that), but rather to know when the user has completed /// [onChanged] for that), but rather to know when the user has completed
/// selecting a new [value] by ending a drag or a click. /// selecting a new [value] by ending a drag or a click.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Slider( /// Slider(
...@@ -231,6 +233,7 @@ class Slider extends StatefulWidget { ...@@ -231,6 +233,7 @@ class Slider extends StatefulWidget {
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -305,7 +308,7 @@ class Slider extends StatefulWidget { ...@@ -305,7 +308,7 @@ class Slider extends StatefulWidget {
/// This is used by accessibility frameworks like TalkBack on Android to /// This is used by accessibility frameworks like TalkBack on Android to
/// inform users what the currently selected value is with more context. /// inform users what the currently selected value is with more context.
/// ///
/// ## Sample code: /// {@tool sample}
/// ///
/// In the example below, a slider for currency values is configured to /// In the example below, a slider for currency values is configured to
/// announce a value with a currency label. /// announce a value with a currency label.
...@@ -326,6 +329,7 @@ class Slider extends StatefulWidget { ...@@ -326,6 +329,7 @@ class Slider extends StatefulWidget {
/// } /// }
/// ) /// )
/// ``` /// ```
/// {@end-tool}
final SemanticFormatterCallback semanticFormatterCallback; final SemanticFormatterCallback semanticFormatterCallback;
@override @override
......
...@@ -48,7 +48,7 @@ class SliderTheme extends InheritedWidget { ...@@ -48,7 +48,7 @@ class SliderTheme extends InheritedWidget {
/// Defaults to the ambient [ThemeData.sliderTheme] if there is no /// Defaults to the ambient [ThemeData.sliderTheme] if there is no
/// [SliderTheme] in the given build context. /// [SliderTheme] in the given build context.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class Launch extends StatefulWidget { /// class Launch extends StatefulWidget {
...@@ -71,6 +71,7 @@ class SliderTheme extends InheritedWidget { ...@@ -71,6 +71,7 @@ class SliderTheme extends InheritedWidget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -155,7 +156,7 @@ class SliderThemeData extends Diagnosticable { ...@@ -155,7 +156,7 @@ class SliderThemeData extends Diagnosticable {
/// [copyWith] on the one you get from [SliderTheme.of], or create an /// [copyWith] on the one you get from [SliderTheme.of], or create an
/// entirely new one with [SliderThemeData.fromPrimaryColors]. /// entirely new one with [SliderThemeData.fromPrimaryColors].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class Blissful extends StatefulWidget { /// class Blissful extends StatefulWidget {
...@@ -178,6 +179,7 @@ class SliderThemeData extends Diagnosticable { ...@@ -178,6 +179,7 @@ class SliderThemeData extends Diagnosticable {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
const SliderThemeData({ const SliderThemeData({
@required this.activeTrackColor, @required this.activeTrackColor,
@required this.inactiveTrackColor, @required this.inactiveTrackColor,
......
...@@ -39,7 +39,7 @@ import 'theme_data.dart'; ...@@ -39,7 +39,7 @@ import 'theme_data.dart';
/// To show the [SwitchListTile] as disabled, pass null as the [onChanged] /// To show the [SwitchListTile] as disabled, pass null as the [onChanged]
/// callback. /// callback.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This widget shows a switch that, when toggled, changes the state of a [bool] /// This widget shows a switch that, when toggled, changes the state of a [bool]
/// member field called `_lights`. /// member field called `_lights`.
...@@ -52,6 +52,7 @@ import 'theme_data.dart'; ...@@ -52,6 +52,7 @@ import 'theme_data.dart';
/// secondary: const Icon(Icons.lightbulb_outline), /// secondary: const Icon(Icons.lightbulb_outline),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -19,7 +19,7 @@ import 'constants.dart'; ...@@ -19,7 +19,7 @@ import 'constants.dart';
/// ancestor, a [TabController] can be shared by providing a /// ancestor, a [TabController] can be shared by providing a
/// [DefaultTabController] inherited widget. /// [DefaultTabController] inherited widget.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This widget introduces a [Scaffold] with an [AppBar] and a [TabBar]. /// This widget introduces a [Scaffold] with an [AppBar] and a [TabBar].
/// ///
...@@ -69,6 +69,7 @@ import 'constants.dart'; ...@@ -69,6 +69,7 @@ import 'constants.dart';
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
class TabController extends ChangeNotifier { class TabController extends ChangeNotifier {
/// Creates an object that manages the state required by [TabBar] and a [TabBarView]. /// Creates an object that manages the state required by [TabBar] and a [TabBarView].
/// ///
......
...@@ -39,7 +39,7 @@ import 'theme.dart'; ...@@ -39,7 +39,7 @@ import 'theme.dart';
/// * [InputDecorator], which shows the labels and other visual elements that /// * [InputDecorator], which shows the labels and other visual elements that
/// surround the actual text editing widget. /// surround the actual text editing widget.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Creates a [TextFormField] with an [InputDecoration] and validator function. /// Creates a [TextFormField] with an [InputDecoration] and validator function.
/// ///
...@@ -59,6 +59,7 @@ import 'theme.dart'; ...@@ -59,6 +59,7 @@ import 'theme.dart';
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
class TextFormField extends FormField<String> { class TextFormField extends FormField<String> {
/// Creates a [FormField] that contains a [TextField]. /// Creates a [FormField] that contains a [TextField].
/// ///
......
...@@ -176,7 +176,7 @@ class TextTheme extends Diagnosticable { ...@@ -176,7 +176,7 @@ class TextTheme extends Diagnosticable {
/// the typography styles in the material design specification, as a starting /// the typography styles in the material design specification, as a starting
/// point. /// point.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// /// A Widget that sets the ambient theme's title text color for its /// /// A Widget that sets the ambient theme's title text color for its
...@@ -203,6 +203,7 @@ class TextTheme extends Diagnosticable { ...@@ -203,6 +203,7 @@ class TextTheme extends Diagnosticable {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -259,7 +260,7 @@ class TextTheme extends Diagnosticable { ...@@ -259,7 +260,7 @@ class TextTheme extends Diagnosticable {
/// [TextTheme] has only some fields defined, and you want to define the rest /// [TextTheme] has only some fields defined, and you want to define the rest
/// by merging it with a default theme. /// by merging it with a default theme.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// /// A Widget that sets the ambient theme's title text color for its /// /// A Widget that sets the ambient theme's title text color for its
...@@ -284,6 +285,7 @@ class TextTheme extends Diagnosticable { ...@@ -284,6 +285,7 @@ class TextTheme extends Diagnosticable {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -29,13 +29,14 @@ enum DayPeriod { ...@@ -29,13 +29,14 @@ enum DayPeriod {
/// minute or using [DateTime] object. /// minute or using [DateTime] object.
/// Hours are specified between 0 and 23, as in a 24-hour clock. /// Hours are specified between 0 and 23, as in a 24-hour clock.
/// ///
/// ### Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// TimeOfDay now = TimeOfDay.now(); /// TimeOfDay now = TimeOfDay.now();
/// TimeOfDay releaseTime = TimeOfDay(hour: 15, minute: 0); // 3:00pm /// TimeOfDay releaseTime = TimeOfDay(hour: 15, minute: 0); // 3:00pm
/// TimeOfDay roomBooked = TimeOfDay.fromDateTime(DateTime.parse('2018-10-20 16:30:04Z')); // 4:30pm /// TimeOfDay roomBooked = TimeOfDay.fromDateTime(DateTime.parse('2018-10-20 16:30:04Z')); // 4:30pm
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -26,7 +26,7 @@ enum BorderStyle { ...@@ -26,7 +26,7 @@ enum BorderStyle {
/// A [Border] consists of four [BorderSide] objects: [Border.top], /// A [Border] consists of four [BorderSide] objects: [Border.top],
/// [Border.left], [Border.right], and [Border.bottom]. /// [Border.left], [Border.right], and [Border.bottom].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample shows how [BorderSide] objects can be used in a [Container], via /// This sample shows how [BorderSide] objects can be used in a [Container], via
/// a [BoxDecoration] and a [Border], to decorate some [Text]. In this example, /// a [BoxDecoration] and a [Border], to decorate some [Text]. In this example,
...@@ -45,6 +45,7 @@ enum BorderStyle { ...@@ -45,6 +45,7 @@ enum BorderStyle {
/// child: Text('Flutter in the sky', textAlign: TextAlign.center), /// child: Text('Flutter in the sky', textAlign: TextAlign.center),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -239,19 +239,23 @@ abstract class BoxBorder extends ShapeBorder { ...@@ -239,19 +239,23 @@ abstract class BoxBorder extends ShapeBorder {
/// ///
/// The sides are represented by [BorderSide] objects. /// The sides are represented by [BorderSide] objects.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// All four borders the same, two-pixel wide solid white: /// All four borders the same, two-pixel wide solid white:
/// ///
/// ```dart /// ```dart
/// Border.all(width: 2.0, color: const Color(0xFFFFFFFF)) /// Border.all(width: 2.0, color: const Color(0xFFFFFFFF))
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// The border for a material design divider: /// The border for a material design divider:
/// ///
/// ```dart /// ```dart
/// Border(bottom: BorderSide(color: Theme.of(context).dividerColor)) /// Border(bottom: BorderSide(color: Theme.of(context).dividerColor))
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// A 1990s-era "OK" button: /// A 1990s-era "OK" button:
/// ///
...@@ -284,6 +288,7 @@ abstract class BoxBorder extends ShapeBorder { ...@@ -284,6 +288,7 @@ abstract class BoxBorder extends ShapeBorder {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -32,7 +32,7 @@ import 'image_provider.dart'; ...@@ -32,7 +32,7 @@ import 'image_provider.dart';
/// ///
/// The [border] paints over the body; the [boxShadow], naturally, paints below it. /// The [border] paints over the body; the [boxShadow], naturally, paints below it.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following example uses the [Container] widget from the widgets layer to /// The following example uses the [Container] widget from the widgets layer to
/// draw an image with a border: /// draw an image with a border:
...@@ -52,6 +52,7 @@ import 'image_provider.dart'; ...@@ -52,6 +52,7 @@ import 'image_provider.dart';
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -102,7 +102,7 @@ class FittedSizes { ...@@ -102,7 +102,7 @@ class FittedSizes {
/// convenience function, [Alignment.inscribe], for resolving the sizes to /// convenience function, [Alignment.inscribe], for resolving the sizes to
/// rects, as shown in the example below. /// rects, as shown in the example below.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This function paints a [dart:ui.Image] `image` onto the [Rect] `outputRect` on a /// This function paints a [dart:ui.Image] `image` onto the [Rect] `outputRect` on a
/// [Canvas] `canvas`, using a [Paint] `paint`, applying the [BoxFit] algorithm /// [Canvas] `canvas`, using a [Paint] `paint`, applying the [BoxFit] algorithm
...@@ -117,6 +117,7 @@ class FittedSizes { ...@@ -117,6 +117,7 @@ class FittedSizes {
/// canvas.drawImageRect(image, inputSubrect, outputSubrect, paint); /// canvas.drawImageRect(image, inputSubrect, outputSubrect, paint);
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -282,7 +282,7 @@ abstract class EdgeInsetsGeometry { ...@@ -282,7 +282,7 @@ abstract class EdgeInsetsGeometry {
/// _start_, top, _end_, and bottom, where start and end are resolved in terms /// _start_, top, _end_, and bottom, where start and end are resolved in terms
/// of a [TextDirection] (typically obtained from the ambient [Directionality]). /// of a [TextDirection] (typically obtained from the ambient [Directionality]).
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Here are some examples of how to create [EdgeInsets] instances: /// Here are some examples of how to create [EdgeInsets] instances:
/// ///
...@@ -291,18 +291,23 @@ abstract class EdgeInsetsGeometry { ...@@ -291,18 +291,23 @@ abstract class EdgeInsetsGeometry {
/// ```dart /// ```dart
/// const EdgeInsets.all(8.0) /// const EdgeInsets.all(8.0)
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// Eight pixel margin above and below, no horizontal margins: /// Eight pixel margin above and below, no horizontal margins:
/// ///
/// ```dart /// ```dart
/// const EdgeInsets.symmetric(vertical: 8.0) /// const EdgeInsets.symmetric(vertical: 8.0)
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// Left margin indent of 40 pixels: /// Left margin indent of 40 pixels:
/// ///
/// ```dart /// ```dart
/// const EdgeInsets.only(left: 40.0) /// const EdgeInsets.only(left: 40.0)
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -316,25 +321,27 @@ class EdgeInsets extends EdgeInsetsGeometry { ...@@ -316,25 +321,27 @@ class EdgeInsets extends EdgeInsetsGeometry {
/// Creates insets where all the offsets are `value`. /// Creates insets where all the offsets are `value`.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Typical eight-pixel margin on all sides: /// Typical eight-pixel margin on all sides:
/// ///
/// ```dart /// ```dart
/// const EdgeInsets.all(8.0) /// const EdgeInsets.all(8.0)
/// ``` /// ```
/// {@end-tool}
const EdgeInsets.all(double value) const EdgeInsets.all(double value)
: left = value, top = value, right = value, bottom = value; : left = value, top = value, right = value, bottom = value;
/// Creates insets with only the given values non-zero. /// Creates insets with only the given values non-zero.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Left margin indent of 40 pixels: /// Left margin indent of 40 pixels:
/// ///
/// ```dart /// ```dart
/// const EdgeInsets.only(left: 40.0) /// const EdgeInsets.only(left: 40.0)
/// ``` /// ```
/// {@end-tool}
const EdgeInsets.only({ const EdgeInsets.only({
this.left = 0.0, this.left = 0.0,
this.top = 0.0, this.top = 0.0,
...@@ -344,13 +351,14 @@ class EdgeInsets extends EdgeInsetsGeometry { ...@@ -344,13 +351,14 @@ class EdgeInsets extends EdgeInsetsGeometry {
/// Creates insets with symmetrical vertical and horizontal offsets. /// Creates insets with symmetrical vertical and horizontal offsets.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Eight pixel margin above and below, no horizontal margins: /// Eight pixel margin above and below, no horizontal margins:
/// ///
/// ```dart /// ```dart
/// const EdgeInsets.symmetric(vertical: 8.0) /// const EdgeInsets.symmetric(vertical: 8.0)
/// ``` /// ```
/// {@end-tool}
const EdgeInsets.symmetric({ double vertical = 0.0, const EdgeInsets.symmetric({ double vertical = 0.0,
double horizontal = 0.0 }) double horizontal = 0.0 })
: left = horizontal, top = vertical, right = horizontal, bottom = vertical; : left = horizontal, top = vertical, right = horizontal, bottom = vertical;
...@@ -600,13 +608,14 @@ class EdgeInsetsDirectional extends EdgeInsetsGeometry { ...@@ -600,13 +608,14 @@ class EdgeInsetsDirectional extends EdgeInsetsGeometry {
/// Creates insets with only the given values non-zero. /// Creates insets with only the given values non-zero.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// A margin indent of 40 pixels on the leading side: /// A margin indent of 40 pixels on the leading side:
/// ///
/// ```dart /// ```dart
/// const EdgeInsetsDirectional.only(start: 40.0) /// const EdgeInsetsDirectional.only(start: 40.0)
/// ``` /// ```
/// {@end-tool}
const EdgeInsetsDirectional.only({ const EdgeInsetsDirectional.only({
this.start = 0.0, this.start = 0.0,
this.top = 0.0, this.top = 0.0,
......
...@@ -226,7 +226,7 @@ abstract class Gradient { ...@@ -226,7 +226,7 @@ abstract class Gradient {
/// Typically this class is used with [BoxDecoration], which does the painting. /// Typically this class is used with [BoxDecoration], which does the painting.
/// To use a [LinearGradient] to paint on a canvas directly, see [createShader]. /// To use a [LinearGradient] to paint on a canvas directly, see [createShader].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample draws a picture that looks like vertical window shades by having /// This sample draws a picture that looks like vertical window shades by having
/// a [Container] display a [BoxDecoration] with a [LinearGradient]. /// a [Container] display a [BoxDecoration] with a [LinearGradient].
...@@ -243,6 +243,7 @@ abstract class Gradient { ...@@ -243,6 +243,7 @@ abstract class Gradient {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -460,7 +461,7 @@ class LinearGradient extends Gradient { ...@@ -460,7 +461,7 @@ class LinearGradient extends Gradient {
/// Typically this class is used with [BoxDecoration], which does the painting. /// Typically this class is used with [BoxDecoration], which does the painting.
/// To use a [RadialGradient] to paint on a canvas directly, see [createShader]. /// To use a [RadialGradient] to paint on a canvas directly, see [createShader].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This function draws a gradient that looks like a sun in a blue sky. /// This function draws a gradient that looks like a sun in a blue sky.
/// ///
...@@ -481,6 +482,7 @@ class LinearGradient extends Gradient { ...@@ -481,6 +482,7 @@ class LinearGradient extends Gradient {
/// canvas.drawRect(rect, paint); /// canvas.drawRect(rect, paint);
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -718,7 +720,7 @@ class RadialGradient extends Gradient { ...@@ -718,7 +720,7 @@ class RadialGradient extends Gradient {
/// Typically this class is used with [BoxDecoration], which does the painting. /// Typically this class is used with [BoxDecoration], which does the painting.
/// To use a [SweepGradient] to paint on a canvas directly, see [createShader]. /// To use a [SweepGradient] to paint on a canvas directly, see [createShader].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample draws a different color in each quadrant. /// This sample draws a different color in each quadrant.
/// ///
...@@ -741,6 +743,7 @@ class RadialGradient extends Gradient { ...@@ -741,6 +743,7 @@ class RadialGradient extends Gradient {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -170,7 +170,7 @@ class ImageConfiguration { ...@@ -170,7 +170,7 @@ class ImageConfiguration {
/// ///
/// The following image formats are supported: {@macro flutter.dart:ui.imageFormats} /// The following image formats are supported: {@macro flutter.dart:ui.imageFormats}
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following shows the code required to write a widget that fully conforms /// The following shows the code required to write a widget that fully conforms
/// to the [ImageProvider] and [Widget] protocols. (It is essentially a /// to the [ImageProvider] and [Widget] protocols. (It is essentially a
...@@ -244,6 +244,7 @@ class ImageConfiguration { ...@@ -244,6 +244,7 @@ class ImageConfiguration {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
@optionalTypeArgs @optionalTypeArgs
abstract class ImageProvider<T> { abstract class ImageProvider<T> {
/// Abstract const constructor. This constructor enables subclasses to provide /// Abstract const constructor. This constructor enables subclasses to provide
...@@ -299,7 +300,7 @@ abstract class ImageProvider<T> { ...@@ -299,7 +300,7 @@ abstract class ImageProvider<T> {
/// The [configuration] is optional and defaults to /// The [configuration] is optional and defaults to
/// [ImageConfiguration.empty]. /// [ImageConfiguration.empty].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following sample code shows how an image loaded using the [Image] /// The following sample code shows how an image loaded using the [Image]
/// widget can be evicted using a [NetworkImage] with a matching url. /// widget can be evicted using a [NetworkImage] with a matching url.
...@@ -322,6 +323,7 @@ abstract class ImageProvider<T> { ...@@ -322,6 +323,7 @@ abstract class ImageProvider<T> {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
Future<bool> evict({ImageCache cache, ImageConfiguration configuration = ImageConfiguration.empty}) async { Future<bool> evict({ImageCache cache, ImageConfiguration configuration = ImageConfiguration.empty}) async {
cache ??= imageCache; cache ??= imageCache;
final T key = await obtainKey(configuration); final T key = await obtainKey(configuration);
......
...@@ -23,7 +23,7 @@ import 'rounded_rectangle_border.dart'; ...@@ -23,7 +23,7 @@ import 'rounded_rectangle_border.dart';
/// optionally filling it with a color or a gradient, optionally painting an /// optionally filling it with a color or a gradient, optionally painting an
/// image into it, and optionally casting a shadow. /// image into it, and optionally casting a shadow.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following example uses the [Container] widget from the widgets layer to /// The following example uses the [Container] widget from the widgets layer to
/// draw a white rectangle with a 24-pixel multicolor outline, with the text /// draw a white rectangle with a 24-pixel multicolor outline, with the text
...@@ -47,6 +47,7 @@ import 'rounded_rectangle_border.dart'; ...@@ -47,6 +47,7 @@ import 'rounded_rectangle_border.dart';
/// child: const Text('RGB', textAlign: TextAlign.center), /// child: const Text('RGB', textAlign: TextAlign.center),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -27,7 +27,7 @@ import 'text_style.dart'; ...@@ -27,7 +27,7 @@ import 'text_style.dart';
/// span in a widget, use a [RichText]. For text with a single style, consider /// span in a widget, use a [RichText]. For text with a single style, consider
/// using the [Text] widget. /// using the [Text] widget.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The text "Hello world!", in black: /// The text "Hello world!", in black:
/// ///
...@@ -37,6 +37,7 @@ import 'text_style.dart'; ...@@ -37,6 +37,7 @@ import 'text_style.dart';
/// style: TextStyle(color: Colors.black), /// style: TextStyle(color: Colors.black),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// _There is some more detailed sample code in the documentation for the /// _There is some more detailed sample code in the documentation for the
/// [recognizer] property._ /// [recognizer] property._
...@@ -93,7 +94,7 @@ class TextSpan extends DiagnosticableTree { ...@@ -93,7 +94,7 @@ class TextSpan extends DiagnosticableTree {
/// The code that owns the [GestureRecognizer] object must call /// The code that owns the [GestureRecognizer] object must call
/// [GestureRecognizer.dispose] when the [TextSpan] object is no longer used. /// [GestureRecognizer.dispose] when the [TextSpan] object is no longer used.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows how to manage the lifetime of a gesture recognizer /// This example shows how to manage the lifetime of a gesture recognizer
/// provided to a [TextSpan] object. It defines a `BuzzingText` widget which /// provided to a [TextSpan] object. It defines a `BuzzingText` widget which
...@@ -152,6 +153,7 @@ class TextSpan extends DiagnosticableTree { ...@@ -152,6 +153,7 @@ class TextSpan extends DiagnosticableTree {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
final GestureRecognizer recognizer; final GestureRecognizer recognizer;
/// Apply the [style], [text], and [children] of this object to the /// Apply the [style], [text], and [children] of this object to the
......
...@@ -18,7 +18,7 @@ const String _kColorForegroundWarning = 'Cannot provide both a color and a foreg ...@@ -18,7 +18,7 @@ const String _kColorForegroundWarning = 'Cannot provide both a color and a foreg
/// An immutable style in which paint text. /// An immutable style in which paint text.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ### Bold /// ### Bold
/// ///
...@@ -32,6 +32,8 @@ const String _kColorForegroundWarning = 'Cannot provide both a color and a foreg ...@@ -32,6 +32,8 @@ const String _kColorForegroundWarning = 'Cannot provide both a color and a foreg
/// style: TextStyle(fontWeight: FontWeight.bold), /// style: TextStyle(fontWeight: FontWeight.bold),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// ### Italics /// ### Italics
/// ///
...@@ -44,6 +46,7 @@ const String _kColorForegroundWarning = 'Cannot provide both a color and a foreg ...@@ -44,6 +46,7 @@ const String _kColorForegroundWarning = 'Cannot provide both a color and a foreg
/// style: TextStyle(fontStyle: FontStyle.italic), /// style: TextStyle(fontStyle: FontStyle.italic),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// ### Opacity and Color /// ### Opacity and Color
/// ///
......
...@@ -12,7 +12,7 @@ import 'simulation.dart'; ...@@ -12,7 +12,7 @@ import 'simulation.dart';
/// Models a particle that follows Newton's second law of motion. The simulation /// Models a particle that follows Newton's second law of motion. The simulation
/// ends when the position reaches a defined point. /// ends when the position reaches a defined point.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This method triggers an [AnimationController] (a previously constructed /// This method triggers an [AnimationController] (a previously constructed
/// `_controller` field) to simulate a fall of 300 pixels. /// `_controller` field) to simulate a fall of 300 pixels.
...@@ -27,6 +27,7 @@ import 'simulation.dart'; ...@@ -27,6 +27,7 @@ import 'simulation.dart';
/// )); /// ));
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// This [AnimationController] could be used with an [AnimatedBuilder] to /// This [AnimationController] could be used with an [AnimatedBuilder] to
/// animate the position of a child as if it was falling. /// animate the position of a child as if it was falling.
......
...@@ -45,7 +45,7 @@ class MultiChildLayoutParentData extends ContainerBoxParentData<RenderBox> { ...@@ -45,7 +45,7 @@ class MultiChildLayoutParentData extends ContainerBoxParentData<RenderBox> {
/// identifies it to the delegate. The [LayoutId.id] needs to be unique among /// identifies it to the delegate. The [LayoutId.id] needs to be unique among
/// the children that the [CustomMultiChildLayout] manages. /// the children that the [CustomMultiChildLayout] manages.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Below is an example implementation of [performLayout] that causes one widget /// Below is an example implementation of [performLayout] that causes one widget
/// (the follower) to be the same size as another (the leader): /// (the follower) to be the same size as another (the leader):
...@@ -80,6 +80,7 @@ class MultiChildLayoutParentData extends ContainerBoxParentData<RenderBox> { ...@@ -80,6 +80,7 @@ class MultiChildLayoutParentData extends ContainerBoxParentData<RenderBox> {
/// bool shouldRelayout(MultiChildLayoutDelegate oldDelegate) => false; /// bool shouldRelayout(MultiChildLayoutDelegate oldDelegate) => false;
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// The delegate gives the leader widget loose constraints, which means the /// The delegate gives the leader widget loose constraints, which means the
/// child determines what size to be (subject to fitting within the given size). /// child determines what size to be (subject to fitting within the given size).
......
...@@ -62,7 +62,7 @@ typedef SemanticsBuilderCallback = List<CustomPainterSemantics> Function(Size si ...@@ -62,7 +62,7 @@ typedef SemanticsBuilderCallback = List<CustomPainterSemantics> Function(Size si
/// class is provided, to check if the new instance contains different /// class is provided, to check if the new instance contains different
/// information that affects the semantics tree. /// information that affects the semantics tree.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample extends the same code shown for [RadialGradient] to create a /// This sample extends the same code shown for [RadialGradient] to create a
/// custom painter that paints a sky. /// custom painter that paints a sky.
...@@ -117,6 +117,7 @@ typedef SemanticsBuilderCallback = List<CustomPainterSemantics> Function(Size si ...@@ -117,6 +117,7 @@ typedef SemanticsBuilderCallback = List<CustomPainterSemantics> Function(Size si
/// bool shouldRebuildSemantics(Sky oldDelegate) => false; /// bool shouldRebuildSemantics(Sky oldDelegate) => false;
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -48,7 +48,7 @@ class _OverflowRegionData { ...@@ -48,7 +48,7 @@ class _OverflowRegionData {
/// overflows. It will print on the first occurrence, and once after each time that /// overflows. It will print on the first occurrence, and once after each time that
/// [reassemble] is called. /// [reassemble] is called.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class MyRenderObject extends RenderAligningShiftedBox with DebugOverflowIndicatorMixin { /// class MyRenderObject extends RenderAligningShiftedBox with DebugOverflowIndicatorMixin {
...@@ -81,6 +81,7 @@ class _OverflowRegionData { ...@@ -81,6 +81,7 @@ class _OverflowRegionData {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -2232,7 +2232,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2232,7 +2232,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// asynchronous computation) will at best have no useful effect and at worse /// asynchronous computation) will at best have no useful effect and at worse
/// will cause crashes as the data will be in an inconsistent state. /// will cause crashes as the data will be in an inconsistent state.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following snippet will describe the node as a button that responds to /// The following snippet will describe the node as a button that responds to
/// tap actions. /// tap actions.
...@@ -2253,6 +2253,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2253,6 +2253,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
@protected @protected
void describeSemanticsConfiguration(SemanticsConfiguration config) { void describeSemanticsConfiguration(SemanticsConfiguration config) {
// Nothing to do by default. // Nothing to do by default.
......
...@@ -2572,7 +2572,7 @@ class RenderRepaintBoundary extends RenderProxyBox { ...@@ -2572,7 +2572,7 @@ class RenderRepaintBoundary extends RenderProxyBox {
/// will give you a 1:1 mapping between logical pixels and the output pixels /// will give you a 1:1 mapping between logical pixels and the output pixels
/// in the image. /// in the image.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following is an example of how to go from a `GlobalKey` on a /// The following is an example of how to go from a `GlobalKey` on a
/// `RepaintBoundary` to a PNG: /// `RepaintBoundary` to a PNG:
...@@ -2610,6 +2610,7 @@ class RenderRepaintBoundary extends RenderProxyBox { ...@@ -2610,6 +2610,7 @@ class RenderRepaintBoundary extends RenderProxyBox {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -135,12 +135,14 @@ class MethodChannel { ...@@ -135,12 +135,14 @@ class MethodChannel {
/// * a [MissingPluginException], if the method has not been implemented by a /// * a [MissingPluginException], if the method has not been implemented by a
/// platform plugin. /// platform plugin.
/// ///
/// ## Sample code
///
/// The following code snippets demonstrate how to invoke platform methods /// The following code snippets demonstrate how to invoke platform methods
/// in Dart using a MethodChannel and how to implement those methods in Java /// in Dart using a MethodChannel and how to implement those methods in Java
/// (for Android) and Objective-C (for iOS). The code might be packaged up as /// (for Android) and Objective-C (for iOS).
/// a musical plugin, see <https://flutter.io/developing-packages/>: ///
/// {@tool sample}
///
/// The code might be packaged up as a musical plugin, see
/// <https://flutter.io/developing-packages/>:
/// ///
/// ```dart /// ```dart
/// class Music { /// class Music {
...@@ -188,6 +190,11 @@ class MethodChannel { ...@@ -188,6 +190,11 @@ class MethodChannel {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
///
/// {@tool sample}
///
/// Java (for Android):
/// ///
/// ```java /// ```java
/// // Assumes existence of an Android MusicApi. /// // Assumes existence of an Android MusicApi.
...@@ -223,8 +230,13 @@ class MethodChannel { ...@@ -223,8 +230,13 @@ class MethodChannel {
/// // Other methods elided. /// // Other methods elided.
/// } /// }
/// ``` /// ```
/// {@end-tool}
///
/// {@tool sample}
///
/// Objective-C (for iOS):
/// ///
/// ```objective-c /// ```objectivec
/// @interface MusicPlugin : NSObject<FlutterPlugin> /// @interface MusicPlugin : NSObject<FlutterPlugin>
/// @end /// @end
/// ///
...@@ -259,6 +271,7 @@ class MethodChannel { ...@@ -259,6 +271,7 @@ class MethodChannel {
/// // Other methods elided. /// // Other methods elided.
/// @end /// @end
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -38,7 +38,7 @@ enum CrossFadeState { ...@@ -38,7 +38,7 @@ enum CrossFadeState {
/// top child and the bottom child should be keyed using the provided /// top child and the bottom child should be keyed using the provided
/// `topChildKey` and `bottomChildKey` keys respectively. /// `topChildKey` and `bottomChildKey` keys respectively.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Widget defaultLayoutBuilder(Widget topChild, Key topChildKey, Widget bottomChild, Key bottomChildKey) { /// Widget defaultLayoutBuilder(Widget topChild, Key topChildKey, Widget bottomChild, Key bottomChildKey) {
...@@ -60,6 +60,7 @@ enum CrossFadeState { ...@@ -60,6 +60,7 @@ enum CrossFadeState {
/// ); /// );
/// } /// }
/// ``` /// ```
/// {@end-tool}
typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChildKey, Widget bottomChild, Key bottomChildKey); typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChildKey, Widget bottomChild, Key bottomChildKey);
/// A widget that cross-fades between two given children and animates itself /// A widget that cross-fades between two given children and animates itself
...@@ -81,7 +82,7 @@ typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChild ...@@ -81,7 +82,7 @@ typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChild
/// [AnimatedCrossFade] is rebuilt with a different value for the /// [AnimatedCrossFade] is rebuilt with a different value for the
/// [crossFadeState] property. /// [crossFadeState] property.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This code fades between two representations of the Flutter logo. It depends /// This code fades between two representations of the Flutter logo. It depends
/// on a boolean field `_first`; when `_first` is true, the first logo is shown, /// on a boolean field `_first`; when `_first` is true, the first logo is shown,
...@@ -97,6 +98,7 @@ typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChild ...@@ -97,6 +98,7 @@ typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChild
/// crossFadeState: _first ? CrossFadeState.showFirst : CrossFadeState.showSecond, /// crossFadeState: _first ? CrossFadeState.showFirst : CrossFadeState.showSecond,
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -87,7 +87,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis ...@@ -87,7 +87,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis
/// progress indicator and the image will be fading out while a new progress /// progress indicator and the image will be fading out while a new progress
/// indicator is fading in.) /// indicator is fading in.)
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class ClickCounter extends StatefulWidget { /// class ClickCounter extends StatefulWidget {
...@@ -136,6 +136,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis ...@@ -136,6 +136,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -342,7 +342,7 @@ typedef AsyncWidgetBuilder<T> = Widget Function(BuildContext context, AsyncSnaps ...@@ -342,7 +342,7 @@ typedef AsyncWidgetBuilder<T> = Widget Function(BuildContext context, AsyncSnaps
/// * [StreamBuilderBase], which supports widget building based on a computation /// * [StreamBuilderBase], which supports widget building based on a computation
/// that spans all interactions made with the stream. /// that spans all interactions made with the stream.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample shows a [StreamBuilder] configuring a text label to show the /// This sample shows a [StreamBuilder] configuring a text label to show the
/// latest bid received for a lot in an auction. Assume the `_lot` field is /// latest bid received for a lot in an auction. Assume the `_lot` field is
...@@ -364,6 +364,7 @@ typedef AsyncWidgetBuilder<T> = Widget Function(BuildContext context, AsyncSnaps ...@@ -364,6 +364,7 @@ typedef AsyncWidgetBuilder<T> = Widget Function(BuildContext context, AsyncSnaps
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
// TODO(ianh): remove unreachable code above once https://github.com/dart-lang/linter/issues/1141 is fixed // TODO(ianh): remove unreachable code above once https://github.com/dart-lang/linter/issues/1141 is fixed
class StreamBuilder<T> extends StreamBuilderBase<T, AsyncSnapshot<T>> { class StreamBuilder<T> extends StreamBuilderBase<T, AsyncSnapshot<T>> {
/// Creates a new [StreamBuilder] that builds itself based on the latest /// Creates a new [StreamBuilder] that builds itself based on the latest
...@@ -473,7 +474,7 @@ class StreamBuilder<T> extends StreamBuilderBase<T, AsyncSnapshot<T>> { ...@@ -473,7 +474,7 @@ class StreamBuilder<T> extends StreamBuilderBase<T, AsyncSnapshot<T>> {
/// `future?.asStream()`, except that snapshots with `ConnectionState.active` /// `future?.asStream()`, except that snapshots with `ConnectionState.active`
/// may appear for the latter, depending on how the stream is implemented. /// may appear for the latter, depending on how the stream is implemented.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample shows a [FutureBuilder] configuring a text label to show the /// This sample shows a [FutureBuilder] configuring a text label to show the
/// state of an asynchronous calculation returning a string. Assume the /// state of an asynchronous calculation returning a string. Assume the
...@@ -498,6 +499,7 @@ class StreamBuilder<T> extends StreamBuilderBase<T, AsyncSnapshot<T>> { ...@@ -498,6 +499,7 @@ class StreamBuilder<T> extends StreamBuilderBase<T, AsyncSnapshot<T>> {
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
// TODO(ianh): remove unreachable code above once https://github.com/dart-lang/linter/issues/1141 is fixed // TODO(ianh): remove unreachable code above once https://github.com/dart-lang/linter/issues/1141 is fixed
class FutureBuilder<T> extends StatefulWidget { class FutureBuilder<T> extends StatefulWidget {
/// Creates a widget that builds itself based on the latest snapshot of /// Creates a widget that builds itself based on the latest snapshot of
......
This diff is collapsed.
...@@ -32,7 +32,7 @@ export 'dart:ui' show AppLifecycleState, Locale; ...@@ -32,7 +32,7 @@ export 'dart:ui' show AppLifecycleState, Locale;
/// handlers must be implemented (and the analyzer will list those that have /// handlers must be implemented (and the analyzer will list those that have
/// been omitted). /// been omitted).
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This [StatefulWidget] implements the parts of the [State] and /// This [StatefulWidget] implements the parts of the [State] and
/// [WidgetsBindingObserver] protocols necessary to react to application /// [WidgetsBindingObserver] protocols necessary to react to application
...@@ -72,6 +72,7 @@ export 'dart:ui' show AppLifecycleState, Locale; ...@@ -72,6 +72,7 @@ export 'dart:ui' show AppLifecycleState, Locale;
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// To respond to other notifications, replace the [didChangeAppLifecycleState] /// To respond to other notifications, replace the [didChangeAppLifecycleState]
/// method above with other methods from this class. /// method above with other methods from this class.
...@@ -109,7 +110,7 @@ abstract class WidgetsBindingObserver { ...@@ -109,7 +110,7 @@ abstract class WidgetsBindingObserver {
/// ///
/// This method exposes notifications from [Window.onMetricsChanged]. /// This method exposes notifications from [Window.onMetricsChanged].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This [StatefulWidget] implements the parts of the [State] and /// This [StatefulWidget] implements the parts of the [State] and
/// [WidgetsBindingObserver] protocols necessary to react when the device is /// [WidgetsBindingObserver] protocols necessary to react when the device is
...@@ -149,6 +150,7 @@ abstract class WidgetsBindingObserver { ...@@ -149,6 +150,7 @@ abstract class WidgetsBindingObserver {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// In general, this is unnecessary as the layout system takes care of /// In general, this is unnecessary as the layout system takes care of
/// automatically recomputing the application geometry when the application /// automatically recomputing the application geometry when the application
...@@ -168,7 +170,7 @@ abstract class WidgetsBindingObserver { ...@@ -168,7 +170,7 @@ abstract class WidgetsBindingObserver {
/// ///
/// This method exposes notifications from [Window.onTextScaleFactorChanged]. /// This method exposes notifications from [Window.onTextScaleFactorChanged].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class TextScaleFactorReactor extends StatefulWidget { /// class TextScaleFactorReactor extends StatefulWidget {
...@@ -204,6 +206,7 @@ abstract class WidgetsBindingObserver { ...@@ -204,6 +206,7 @@ abstract class WidgetsBindingObserver {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -20,7 +20,7 @@ import 'image.dart'; ...@@ -20,7 +20,7 @@ import 'image.dart';
/// ///
/// Commonly used with [BoxDecoration]. /// Commonly used with [BoxDecoration].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample shows a radial gradient that draws a moon on a night sky: /// This sample shows a radial gradient that draws a moon on a night sky:
/// ///
...@@ -39,6 +39,7 @@ import 'image.dart'; ...@@ -39,6 +39,7 @@ import 'image.dart';
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -178,7 +179,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -178,7 +179,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// [padding] (e.g. borders in a [BoxDecoration] contribute to the [padding]); /// [padding] (e.g. borders in a [BoxDecoration] contribute to the [padding]);
/// see [Decoration.padding]. /// see [Decoration.padding].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows a 48x48 green square (placed inside a [Center] widget in /// This example shows a 48x48 green square (placed inside a [Center] widget in
/// case the parent widget has its own opinions regarding the size that the /// case the parent widget has its own opinions regarding the size that the
...@@ -195,6 +196,8 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -195,6 +196,8 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// This example shows how to use many of the features of [Container] at once. /// This example shows how to use many of the features of [Container] at once.
/// The [constraints] are set to fit the font size plus ample headroom /// The [constraints] are set to fit the font size plus ample headroom
...@@ -223,6 +226,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -223,6 +226,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// transform: Matrix4.rotationZ(0.1), /// transform: Matrix4.rotationZ(0.1),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -49,7 +49,7 @@ import 'ticker_provider.dart'; ...@@ -49,7 +49,7 @@ import 'ticker_provider.dart';
/// different image. This is known as "gapless playback" (see also /// different image. This is known as "gapless playback" (see also
/// [Image.gaplessPlayback]). /// [Image.gaplessPlayback]).
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// FadeInImage( /// FadeInImage(
...@@ -58,6 +58,7 @@ import 'ticker_provider.dart'; ...@@ -58,6 +58,7 @@ import 'ticker_provider.dart';
/// image: NetworkImage('https://backend.example.com/image.png'), /// image: NetworkImage('https://backend.example.com/image.png'),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
class FadeInImage extends StatefulWidget { class FadeInImage extends StatefulWidget {
/// Creates a widget that displays a [placeholder] while an [image] is loading /// Creates a widget that displays a [placeholder] while an [image] is loading
/// then cross-fades to display the [image]. /// then cross-fades to display the [image].
......
...@@ -498,7 +498,7 @@ abstract class Widget extends DiagnosticableTree { ...@@ -498,7 +498,7 @@ abstract class Widget extends DiagnosticableTree {
/// widget, so that only the inner-most widget needs to be rebuilt when the /// widget, so that only the inner-most widget needs to be rebuilt when the
/// theme changes. /// theme changes.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following is a skeleton of a stateless widget subclass called `GreenFrog`: /// The following is a skeleton of a stateless widget subclass called `GreenFrog`:
/// ///
...@@ -512,6 +512,8 @@ abstract class Widget extends DiagnosticableTree { ...@@ -512,6 +512,8 @@ abstract class Widget extends DiagnosticableTree {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// Normally widgets have more constructor arguments, each of which corresponds /// Normally widgets have more constructor arguments, each of which corresponds
/// to a `final` property. The next example shows the more generic widget `Frog` /// to a `final` property. The next example shows the more generic widget `Frog`
...@@ -535,6 +537,7 @@ abstract class Widget extends DiagnosticableTree { ...@@ -535,6 +537,7 @@ abstract class Widget extends DiagnosticableTree {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// By convention, widget constructors only use named arguments. Named arguments /// By convention, widget constructors only use named arguments. Named arguments
/// can be marked as required using [@required]. Also by convention, the first /// can be marked as required using [@required]. Also by convention, the first
...@@ -705,7 +708,7 @@ abstract class StatelessWidget extends Widget { ...@@ -705,7 +708,7 @@ abstract class StatelessWidget extends Widget {
/// [KeyedSubtree] widget may be useful for this purpose if no other widget /// [KeyedSubtree] widget may be useful for this purpose if no other widget
/// can conveniently be assigned the key.) /// can conveniently be assigned the key.)
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following is a skeleton of a stateful widget subclass called `YellowBird`: /// The following is a skeleton of a stateful widget subclass called `YellowBird`:
/// ///
...@@ -724,6 +727,8 @@ abstract class StatelessWidget extends Widget { ...@@ -724,6 +727,8 @@ abstract class StatelessWidget extends Widget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// In this example. the [State] has no actual state. State is normally /// In this example. the [State] has no actual state. State is normally
/// represented as private member fields. Also, normally widgets have more /// represented as private member fields. Also, normally widgets have more
...@@ -765,6 +770,7 @@ abstract class StatelessWidget extends Widget { ...@@ -765,6 +770,7 @@ abstract class StatelessWidget extends Widget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// By convention, widget constructors only use named arguments. Named arguments /// By convention, widget constructors only use named arguments. Named arguments
/// can be marked as required using [@required]. Also by convention, the first /// can be marked as required using [@required]. Also by convention, the first
...@@ -1366,7 +1372,7 @@ abstract class ProxyWidget extends Widget { ...@@ -1366,7 +1372,7 @@ abstract class ProxyWidget extends Widget {
/// thus also to a particular [RenderObjectWidget] class. That class is `T`, the /// thus also to a particular [RenderObjectWidget] class. That class is `T`, the
/// [ParentDataWidget] type argument. /// [ParentDataWidget] type argument.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows how you would build a [ParentDataWidget] to configure a /// This example shows how you would build a [ParentDataWidget] to configure a
/// `FrogJar` widget's children by specifying a [Size] for each one. /// `FrogJar` widget's children by specifying a [Size] for each one.
...@@ -1394,6 +1400,7 @@ abstract class ProxyWidget extends Widget { ...@@ -1394,6 +1400,7 @@ abstract class ProxyWidget extends Widget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -1496,7 +1503,7 @@ abstract class ParentDataWidget<T extends RenderObjectWidget> extends ProxyWidge ...@@ -1496,7 +1503,7 @@ abstract class ParentDataWidget<T extends RenderObjectWidget> extends ProxyWidge
/// Inherited widgets, when referenced in this way, will cause the consumer to /// Inherited widgets, when referenced in this way, will cause the consumer to
/// rebuild when the inherited widget itself changes state. /// rebuild when the inherited widget itself changes state.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following is a skeleton of an inherited widget called `FrogColor`: /// The following is a skeleton of an inherited widget called `FrogColor`:
/// ///
...@@ -1520,6 +1527,7 @@ abstract class ParentDataWidget<T extends RenderObjectWidget> extends ProxyWidge ...@@ -1520,6 +1527,7 @@ abstract class ParentDataWidget<T extends RenderObjectWidget> extends ProxyWidge
/// bool updateShouldNotify(FrogColor old) => color != old.color; /// bool updateShouldNotify(FrogColor old) => color != old.color;
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// The convention is to provide a static method `of` on the [InheritedWidget] /// The convention is to provide a static method `of` on the [InheritedWidget]
/// which does the call to [BuildContext.inheritFromWidgetOfExactType]. This /// which does the call to [BuildContext.inheritFromWidgetOfExactType]. This
...@@ -1988,13 +1996,14 @@ abstract class BuildContext { ...@@ -1988,13 +1996,14 @@ abstract class BuildContext {
/// an ancestor from one of those methods, save a reference to the ancestor /// an ancestor from one of those methods, save a reference to the ancestor
/// by calling [ancestorStateOfType] in [State.didChangeDependencies]. /// by calling [ancestorStateOfType] in [State.didChangeDependencies].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// ScrollableState scrollable = context.ancestorStateOfType( /// ScrollableState scrollable = context.ancestorStateOfType(
/// const TypeMatcher<ScrollableState>(), /// const TypeMatcher<ScrollableState>(),
/// ); /// );
/// ``` /// ```
/// {@end-tool}
State ancestorStateOfType(TypeMatcher matcher); State ancestorStateOfType(TypeMatcher matcher);
/// Returns the [State] object of the furthest ancestor [StatefulWidget] widget /// Returns the [State] object of the furthest ancestor [StatefulWidget] widget
......
...@@ -113,7 +113,7 @@ class GestureRecognizerFactoryWithHandlers<T extends GestureRecognizer> extends ...@@ -113,7 +113,7 @@ class GestureRecognizerFactoryWithHandlers<T extends GestureRecognizer> extends
/// effects. The [InkWell] class implements this effect and can be used in place /// effects. The [InkWell] class implements this effect and can be used in place
/// of a [GestureDetector] for handling taps. /// of a [GestureDetector] for handling taps.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example makes a rectangle react to being tapped by setting the /// This example makes a rectangle react to being tapped by setting the
/// `_lights` field: /// `_lights` field:
...@@ -129,6 +129,7 @@ class GestureRecognizerFactoryWithHandlers<T extends GestureRecognizer> extends ...@@ -129,6 +129,7 @@ class GestureRecognizerFactoryWithHandlers<T extends GestureRecognizer> extends
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// ## Debugging /// ## Debugging
/// ///
...@@ -453,7 +454,7 @@ class GestureDetector extends StatelessWidget { ...@@ -453,7 +454,7 @@ class GestureDetector extends StatelessWidget {
/// Configuring the gesture recognizers requires a carefully constructed map, as /// Configuring the gesture recognizers requires a carefully constructed map, as
/// described in [gestures] and as shown in the example below. /// described in [gestures] and as shown in the example below.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows how to hook up a [TapGestureRecognizer]. It assumes that /// This example shows how to hook up a [TapGestureRecognizer]. It assumes that
/// the code is being used inside a [State] object with a `_last` field that is /// the code is being used inside a [State] object with a `_last` field that is
...@@ -476,6 +477,7 @@ class GestureDetector extends StatelessWidget { ...@@ -476,6 +477,7 @@ class GestureDetector extends StatelessWidget {
/// child: Container(width: 300.0, height: 300.0, color: Colors.yellow, child: Text(_last)), /// child: Container(width: 300.0, height: 300.0, color: Colors.yellow, child: Text(_last)),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -298,7 +298,7 @@ class Image extends StatefulWidget { ...@@ -298,7 +298,7 @@ class Image extends StatefulWidget {
/// which corresponds to bilinear interpolation, rather than the default /// which corresponds to bilinear interpolation, rather than the default
/// [FilterQuality.none] which corresponds to nearest-neighbor. /// [FilterQuality.none] which corresponds to nearest-neighbor.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// Suppose that the project's `pubspec.yaml` file contains the following: /// Suppose that the project's `pubspec.yaml` file contains the following:
/// ///
...@@ -309,6 +309,7 @@ class Image extends StatefulWidget { ...@@ -309,6 +309,7 @@ class Image extends StatefulWidget {
/// - images/2x/cat.png /// - images/2x/cat.png
/// - images/3.5x/cat.png /// - images/3.5x/cat.png
/// ``` /// ```
/// {@end-tool}
/// ///
/// On a screen with a device pixel ratio of 2.0, the following widget would /// On a screen with a device pixel ratio of 2.0, the following widget would
/// render the `images/2x/cat.png` file: /// render the `images/2x/cat.png` file:
...@@ -336,11 +337,13 @@ class Image extends StatefulWidget { ...@@ -336,11 +337,13 @@ class Image extends StatefulWidget {
/// must be provided. For instance, suppose a package called `my_icons` has /// must be provided. For instance, suppose a package called `my_icons` has
/// `icons/heart.png` . /// `icons/heart.png` .
/// ///
/// {@tool sample}
/// Then to display the image, use: /// Then to display the image, use:
/// ///
/// ```dart /// ```dart
/// Image.asset('icons/heart.png', package: 'my_icons') /// Image.asset('icons/heart.png', package: 'my_icons')
/// ``` /// ```
/// {@end-tool}
/// ///
/// Assets used by the package itself should also be displayed using the /// Assets used by the package itself should also be displayed using the
/// [package] argument as above. /// [package] argument as above.
......
...@@ -1018,7 +1018,7 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat ...@@ -1018,7 +1018,7 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat
/// of [Curves.fastOutSlowIn]. /// of [Curves.fastOutSlowIn].
/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_opacity.mp4} /// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_opacity.mp4}
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// class LogoFade extends StatefulWidget { /// class LogoFade extends StatefulWidget {
...@@ -1052,6 +1052,7 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat ...@@ -1052,6 +1052,7 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -297,7 +297,7 @@ class _LocalizationsScope extends InheritedWidget { ...@@ -297,7 +297,7 @@ class _LocalizationsScope extends InheritedWidget {
/// `Localizations.of(context)` will be rebuilt after the resources /// `Localizations.of(context)` will be rebuilt after the resources
/// for the new locale have been loaded. /// for the new locale have been loaded.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This following class is defined in terms of the /// This following class is defined in terms of the
/// [Dart `intl` package](https://github.com/dart-lang/intl). Using the `intl` /// [Dart `intl` package](https://github.com/dart-lang/intl). Using the `intl`
...@@ -324,6 +324,7 @@ class _LocalizationsScope extends InheritedWidget { ...@@ -324,6 +324,7 @@ class _LocalizationsScope extends InheritedWidget {
/// // ... more Intl.message() methods like title() /// // ... more Intl.message() methods like title()
/// } /// }
/// ``` /// ```
/// {@end-tool}
/// A class based on the `intl` package imports a generated message catalog that provides /// A class based on the `intl` package imports a generated message catalog that provides
/// the `initializeMessages()` function and the per-locale backing store for `Intl.message()`. /// the `initializeMessages()` function and the per-locale backing store for `Intl.message()`.
/// The message catalog is produced by an `intl` tool that analyzes the source code for /// The message catalog is produced by an `intl` tool that analyzes the source code for
......
...@@ -60,7 +60,7 @@ typedef NestedScrollViewHeaderSliversBuilder = List<Widget> Function(BuildContex ...@@ -60,7 +60,7 @@ typedef NestedScrollViewHeaderSliversBuilder = List<Widget> Function(BuildContex
/// (those inside the [TabBarView], hooking them together so that they appear, /// (those inside the [TabBarView], hooking them together so that they appear,
/// to the user, as one coherent scroll view. /// to the user, as one coherent scroll view.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows a [NestedScrollView] whose header is the combination of a /// This example shows a [NestedScrollView] whose header is the combination of a
/// [TabBar] in a [SliverAppBar] and whose body is a [TabBarView]. It uses a /// [TabBar] in a [SliverAppBar] and whose body is a [TabBarView]. It uses a
...@@ -174,6 +174,7 @@ typedef NestedScrollViewHeaderSliversBuilder = List<Widget> Function(BuildContex ...@@ -174,6 +174,7 @@ typedef NestedScrollViewHeaderSliversBuilder = List<Widget> Function(BuildContex
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
class NestedScrollView extends StatefulWidget { class NestedScrollView extends StatefulWidget {
/// Creates a nested scroll view. /// Creates a nested scroll view.
/// ///
......
...@@ -325,7 +325,7 @@ mixin LocalHistoryRoute<T> on Route<T> { ...@@ -325,7 +325,7 @@ mixin LocalHistoryRoute<T> on Route<T> {
/// The given local history entry must not already be part of another local /// The given local history entry must not already be part of another local
/// history route. /// history route.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// The following example is an app with 2 pages: `HomePage` and `SecondPage`. /// The following example is an app with 2 pages: `HomePage` and `SecondPage`.
/// The `HomePage` can navigate to the `SecondPage`. /// The `HomePage` can navigate to the `SecondPage`.
...@@ -442,6 +442,7 @@ mixin LocalHistoryRoute<T> on Route<T> { ...@@ -442,6 +442,7 @@ mixin LocalHistoryRoute<T> on Route<T> {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
void addLocalHistoryEntry(LocalHistoryEntry entry) { void addLocalHistoryEntry(LocalHistoryEntry entry) {
assert(entry._owner == null); assert(entry._owner == null);
entry._owner = this; entry._owner = this;
...@@ -1267,7 +1268,7 @@ abstract class PopupRoute<T> extends ModalRoute<T> { ...@@ -1267,7 +1268,7 @@ abstract class PopupRoute<T> extends ModalRoute<T> {
/// than only specific subtypes. For example, to watch for all [PageRoute] /// than only specific subtypes. For example, to watch for all [PageRoute]
/// variants, the `RouteObserver<PageRoute<dynamic>>` type may be used. /// variants, the `RouteObserver<PageRoute<dynamic>>` type may be used.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// To make a [StatefulWidget] aware of its current [Route] state, implement /// To make a [StatefulWidget] aware of its current [Route] state, implement
/// [RouteAware] in its [State] and subscribe it to a [RouteObserver]: /// [RouteAware] in its [State] and subscribe it to a [RouteObserver]:
...@@ -1316,6 +1317,7 @@ abstract class PopupRoute<T> extends ModalRoute<T> { ...@@ -1316,6 +1317,7 @@ abstract class PopupRoute<T> extends ModalRoute<T> {
/// ///
/// } /// }
/// ``` /// ```
/// {@end-tool}
class RouteObserver<R extends Route<dynamic>> extends NavigatorObserver { class RouteObserver<R extends Route<dynamic>> extends NavigatorObserver {
final Map<R, Set<RouteAware>> _listeners = <R, Set<RouteAware>>{}; final Map<R, Set<RouteAware>> _listeners = <R, Set<RouteAware>>{};
......
...@@ -283,7 +283,7 @@ class ScrollController extends ChangeNotifier { ...@@ -283,7 +283,7 @@ class ScrollController extends ChangeNotifier {
/// It tracks the most recently updated scroll position and reports it as its /// It tracks the most recently updated scroll position and reports it as its
/// `initialScrollOffset`. /// `initialScrollOffset`.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// In this example each [PageView] page contains a [ListView] and all three /// In this example each [PageView] page contains a [ListView] and all three
/// [ListView]'s share a [TrackingScrollController]. The scroll offsets of all /// [ListView]'s share a [TrackingScrollController]. The scroll offsets of all
...@@ -308,6 +308,7 @@ class ScrollController extends ChangeNotifier { ...@@ -308,6 +308,7 @@ class ScrollController extends ChangeNotifier {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// In this example the `_trackingController` would have been created by the /// In this example the `_trackingController` would have been created by the
/// stateful widget that built the widget tree. /// stateful widget that built the widget tree.
......
...@@ -284,7 +284,7 @@ abstract class ScrollView extends StatelessWidget { ...@@ -284,7 +284,7 @@ abstract class ScrollView extends StatelessWidget {
/// To control the initial scroll offset of the scroll view, provide a /// To control the initial scroll offset of the scroll view, provide a
/// [controller] with its [ScrollController.initialScrollOffset] property set. /// [controller] with its [ScrollController.initialScrollOffset] property set.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample code shows a scroll view that contains a flexible pinned app /// This sample code shows a scroll view that contains a flexible pinned app
/// bar, a grid, and an infinite list. /// bar, a grid, and an infinite list.
...@@ -332,6 +332,7 @@ abstract class ScrollView extends StatelessWidget { ...@@ -332,6 +332,7 @@ abstract class ScrollView extends StatelessWidget {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// ## Accessibility /// ## Accessibility
/// ///
...@@ -539,7 +540,7 @@ abstract class BoxScrollView extends ScrollView { ...@@ -539,7 +540,7 @@ abstract class BoxScrollView extends ScrollView {
/// extremities to avoid partial obstructions indicated by [MediaQuery]'s /// extremities to avoid partial obstructions indicated by [MediaQuery]'s
/// padding. To avoid this behavior, override with a zero [padding] property. /// padding. To avoid this behavior, override with a zero [padding] property.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// An infinite list of children: /// An infinite list of children:
/// ///
...@@ -552,6 +553,7 @@ abstract class BoxScrollView extends ScrollView { ...@@ -552,6 +553,7 @@ abstract class BoxScrollView extends ScrollView {
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// ## Child elements' lifecycle /// ## Child elements' lifecycle
/// ///
...@@ -648,7 +650,7 @@ abstract class BoxScrollView extends ScrollView { ...@@ -648,7 +650,7 @@ abstract class BoxScrollView extends ScrollView {
/// [SliverGrid] or [SliverAppBar], can be put in the [CustomScrollView.slivers] /// [SliverGrid] or [SliverAppBar], can be put in the [CustomScrollView.slivers]
/// list. /// list.
/// ///
/// ### Sample code /// {@tool sample}
/// ///
/// Here are two brief snippets showing a [ListView] and its equivalent using /// Here are two brief snippets showing a [ListView] and its equivalent using
/// [CustomScrollView]: /// [CustomScrollView]:
...@@ -665,6 +667,8 @@ abstract class BoxScrollView extends ScrollView { ...@@ -665,6 +667,8 @@ abstract class BoxScrollView extends ScrollView {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// ```dart /// ```dart
/// CustomScrollView( /// CustomScrollView(
...@@ -686,6 +690,7 @@ abstract class BoxScrollView extends ScrollView { ...@@ -686,6 +690,7 @@ abstract class BoxScrollView extends ScrollView {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -836,7 +841,7 @@ class ListView extends BoxScrollView { ...@@ -836,7 +841,7 @@ class ListView extends BoxScrollView {
/// advance, or all at once when the [ListView] itself is created, it is more /// advance, or all at once when the [ListView] itself is created, it is more
/// efficient to use [new ListView]. /// efficient to use [new ListView].
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example shows how to create [ListView] whose [ListTile] list items /// This example shows how to create [ListView] whose [ListTile] list items
/// are separated by [Divider]s. /// are separated by [Divider]s.
...@@ -852,6 +857,7 @@ class ListView extends BoxScrollView { ...@@ -852,6 +857,7 @@ class ListView extends BoxScrollView {
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// The `addAutomaticKeepAlives` argument corresponds to the /// The `addAutomaticKeepAlives` argument corresponds to the
/// [SliverChildBuilderDelegate.addAutomaticKeepAlives] property. The /// [SliverChildBuilderDelegate.addAutomaticKeepAlives] property. The
...@@ -1047,7 +1053,7 @@ class ListView extends BoxScrollView { ...@@ -1047,7 +1053,7 @@ class ListView extends BoxScrollView {
/// [SliverList] or [SliverAppBar], can be put in the [CustomScrollView.slivers] /// [SliverList] or [SliverAppBar], can be put in the [CustomScrollView.slivers]
/// list. /// list.
/// ///
/// ### Sample code /// {@tool sample}
/// ///
/// Here are two brief snippets showing a [GridView] and its equivalent using /// Here are two brief snippets showing a [GridView] and its equivalent using
/// [CustomScrollView]: /// [CustomScrollView]:
...@@ -1068,6 +1074,8 @@ class ListView extends BoxScrollView { ...@@ -1068,6 +1074,8 @@ class ListView extends BoxScrollView {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// {@tool sample}
/// ///
/// ```dart /// ```dart
/// CustomScrollView( /// CustomScrollView(
...@@ -1091,6 +1099,7 @@ class ListView extends BoxScrollView { ...@@ -1091,6 +1099,7 @@ class ListView extends BoxScrollView {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -220,7 +220,7 @@ abstract class SliverChildDelegate { ...@@ -220,7 +220,7 @@ abstract class SliverChildDelegate {
/// delegates where the first has 10 children contributing semantics, then the /// delegates where the first has 10 children contributing semantics, then the
/// second delegate should offset its children by 10. /// second delegate should offset its children by 10.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample code shows how to use `semanticIndexOffset` to handle multiple /// This sample code shows how to use `semanticIndexOffset` to handle multiple
/// delegates in a single scroll view. /// delegates in a single scroll view.
...@@ -251,6 +251,7 @@ abstract class SliverChildDelegate { ...@@ -251,6 +251,7 @@ abstract class SliverChildDelegate {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// In certain cases, only a subset of child widgets should be annotated /// In certain cases, only a subset of child widgets should be annotated
/// with a semantic index. For example, in [new ListView.separated()] the /// with a semantic index. For example, in [new ListView.separated()] the
...@@ -258,7 +259,7 @@ abstract class SliverChildDelegate { ...@@ -258,7 +259,7 @@ abstract class SliverChildDelegate {
/// providing a `semanticIndexCallback` which returns null for separators /// providing a `semanticIndexCallback` which returns null for separators
/// indexes and rounds the non-separator indexes down by half. /// indexes and rounds the non-separator indexes down by half.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This sample code shows how to use `semanticIndexCallback` to handle /// This sample code shows how to use `semanticIndexCallback` to handle
/// annotating a subset of child nodes with a semantic index. There is /// annotating a subset of child nodes with a semantic index. There is
...@@ -290,6 +291,7 @@ abstract class SliverChildDelegate { ...@@ -290,6 +291,7 @@ abstract class SliverChildDelegate {
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
...@@ -677,7 +679,7 @@ class SliverList extends SliverMultiBoxAdaptorWidget { ...@@ -677,7 +679,7 @@ class SliverList extends SliverMultiBoxAdaptorWidget {
/// [SliverFixedExtentList] does not need to perform layout on its children to /// [SliverFixedExtentList] does not need to perform layout on its children to
/// obtain their extent in the main axis. /// obtain their extent in the main axis.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example, which would be inserted into a [CustomScrollView.slivers] /// This example, which would be inserted into a [CustomScrollView.slivers]
/// list, shows an infinite number of items in varying shades of blue: /// list, shows an infinite number of items in varying shades of blue:
...@@ -696,6 +698,7 @@ class SliverList extends SliverMultiBoxAdaptorWidget { ...@@ -696,6 +698,7 @@ class SliverList extends SliverMultiBoxAdaptorWidget {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// {@macro flutter.widgets.sliverChildDelegate.lifecycle} /// {@macro flutter.widgets.sliverChildDelegate.lifecycle}
/// ///
...@@ -741,7 +744,7 @@ class SliverFixedExtentList extends SliverMultiBoxAdaptorWidget { ...@@ -741,7 +744,7 @@ class SliverFixedExtentList extends SliverMultiBoxAdaptorWidget {
/// The main axis direction of a grid is the direction in which it scrolls; the /// The main axis direction of a grid is the direction in which it scrolls; the
/// cross axis direction is the orthogonal direction. /// cross axis direction is the orthogonal direction.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This example, which would be inserted into a [CustomScrollView.slivers] /// This example, which would be inserted into a [CustomScrollView.slivers]
/// list, shows twenty boxes in a pretty teal grid: /// list, shows twenty boxes in a pretty teal grid:
...@@ -766,6 +769,7 @@ class SliverFixedExtentList extends SliverMultiBoxAdaptorWidget { ...@@ -766,6 +769,7 @@ class SliverFixedExtentList extends SliverMultiBoxAdaptorWidget {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// {@macro flutter.widgets.sliverChildDelegate.lifecycle} /// {@macro flutter.widgets.sliverChildDelegate.lifecycle}
/// ///
......
...@@ -17,7 +17,7 @@ import 'framework.dart'; ...@@ -17,7 +17,7 @@ import 'framework.dart';
/// [Spacer] has taken up all of the additional space, therefore there is none /// [Spacer] has taken up all of the additional space, therefore there is none
/// left to redistribute. /// left to redistribute.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Row( /// Row(
...@@ -31,6 +31,7 @@ import 'framework.dart'; ...@@ -31,6 +31,7 @@ import 'framework.dart';
/// ], /// ],
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// See also: /// See also:
/// ///
......
...@@ -167,7 +167,7 @@ class DefaultTextStyle extends InheritedWidget { ...@@ -167,7 +167,7 @@ class DefaultTextStyle extends InheritedWidget {
/// behavior is useful, for example, to make the text bold while using the /// behavior is useful, for example, to make the text bold while using the
/// default font family and size. /// default font family and size.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// Text( /// Text(
...@@ -177,13 +177,14 @@ class DefaultTextStyle extends InheritedWidget { ...@@ -177,13 +177,14 @@ class DefaultTextStyle extends InheritedWidget {
/// style: TextStyle(fontWeight: FontWeight.bold), /// style: TextStyle(fontWeight: FontWeight.bold),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// Using the [Text.rich] constructor, the [Text] widget can /// Using the [Text.rich] constructor, the [Text] widget can
/// display a paragraph with differently styled [TextSpan]s. The sample /// display a paragraph with differently styled [TextSpan]s. The sample
/// that follows displays "Hello beautiful world" with different styles /// that follows displays "Hello beautiful world" with different styles
/// for each word. /// for each word.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// ```dart /// ```dart
/// const Text.rich( /// const Text.rich(
...@@ -196,6 +197,7 @@ class DefaultTextStyle extends InheritedWidget { ...@@ -196,6 +197,7 @@ class DefaultTextStyle extends InheritedWidget {
/// ), /// ),
/// ) /// )
/// ``` /// ```
/// {@end-tool}
/// ///
/// ## Interactivity /// ## Interactivity
/// ///
......
...@@ -760,7 +760,7 @@ class DefaultTextStyleTransition extends AnimatedWidget { ...@@ -760,7 +760,7 @@ class DefaultTextStyleTransition extends AnimatedWidget {
/// Using this pre-built child is entirely optional, but can improve /// Using this pre-built child is entirely optional, but can improve
/// performance significantly in some cases and is therefore a good practice. /// performance significantly in some cases and is therefore a good practice.
/// ///
/// ## Sample code /// {@tool sample}
/// ///
/// This code defines a widget called `Spinner` that spins a green square /// This code defines a widget called `Spinner` that spins a green square
/// continually. It is built with an [AnimatedBuilder] and makes use of the /// continually. It is built with an [AnimatedBuilder] and makes use of the
...@@ -805,6 +805,7 @@ class DefaultTextStyleTransition extends AnimatedWidget { ...@@ -805,6 +805,7 @@ class DefaultTextStyleTransition extends AnimatedWidget {
/// } /// }
/// } /// }
/// ``` /// ```
/// {@end-tool}
class AnimatedBuilder extends AnimatedWidget { class AnimatedBuilder extends AnimatedWidget {
/// Creates an animated builder. /// Creates an animated builder.
/// ///
......
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