Add links to implicit animation illustrations. (#21092)
This adds links to the already existing animated diagrams in the asset-for-api-docs repo.
diff --git a/packages/flutter/lib/src/material/theme.dart b/packages/flutter/lib/src/material/theme.dart
index 5a16304..cebb86b 100644
--- a/packages/flutter/lib/src/material/theme.dart
+++ b/packages/flutter/lib/src/material/theme.dart
@@ -191,6 +191,10 @@
/// Animated version of [Theme] which automatically transitions the colors,
/// etc, over a given duration whenever the given theme changes.
///
+/// Here's an illustration of what using this widget looks like, using a [curve]
+/// of [Curves.elasticInOut].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_theme.mp4}
+///
/// See also:
///
/// * [Theme], which [AnimatedTheme] uses to actually apply the interpolated
diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart
index 22ba326..7c86e4a 100644
--- a/packages/flutter/lib/src/widgets/implicit_animations.dart
+++ b/packages/flutter/lib/src/widgets/implicit_animations.dart
@@ -404,11 +404,20 @@
/// [AnimatedWidget] such as the [DecoratedBoxTransition] or use your own
/// [AnimationController].
///
+/// Here's an illustration of what using this widget looks like, using a [curve]
+/// of [Curves.fastOutSlowIn].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_container.mp4}
+///
/// See also:
///
/// * [AnimatedPadding], which is a subset of this widget that only
/// supports animating the [padding].
/// * The [catalog of layout widgets](https://flutter.io/widgets/layout/).
+/// * [AnimatedPositioned], which, as a child of a [Stack], automatically
+/// transitions its child's position over a given duration whenever the given
+/// position changes.
+/// * [AnimatedAlign], which automatically transitions its child's
+/// position over a given duration whenever the given [alignment] changes.
class AnimatedContainer extends ImplicitlyAnimatedWidget {
/// Creates a container that animates its parameters implicitly.
///
@@ -564,9 +573,15 @@
/// Animated version of [Padding] which automatically transitions the
/// indentation over a given duration whenever the given inset changes.
///
+/// Here's an illustration of what using this widget looks like, using a [curve]
+/// of [Curves.fastOutSlowIn].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_padding.mp4}
+///
/// See also:
///
/// * [AnimatedContainer], which can transition more values at once.
+/// * [AnimatedAlign], which automatically transitions its child's
+/// position over a given duration whenever the given [alignment] changes.
class AnimatedPadding extends ImplicitlyAnimatedWidget {
/// Creates a widget that insets its child by a value that animates
/// implicitly.
@@ -626,9 +641,18 @@
/// Animated version of [Align] which automatically transitions the child's
/// position over a given duration whenever the given [alignment] changes.
///
+/// Here's an illustration of what this can look like, using a [curve] of
+/// [Curves.fastOutSlowIn].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_align.mp4}
+///
/// See also:
///
/// * [AnimatedContainer], which can transition more values at once.
+/// * [AnimatedPadding], which can animate the padding instead of the
+/// alignment.
+/// * [AnimatedPositioned], which, as a child of a [Stack], automatically
+/// transitions its child's position over a given duration whenever the given
+/// position changes.
class AnimatedAlign extends ImplicitlyAnimatedWidget {
/// Creates a widget that positions its child by an alignment that animates
/// implicitly.
@@ -711,6 +735,10 @@
/// frame of the animation, whereas [AnimatedPositioned] will trigger a relayout
/// as well.
///
+/// Here's an illustration of what using this widget looks like, using a [curve]
+/// of [Curves.fastOutSlowIn].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_positioned.mp4}
+///
/// See also:
///
/// * [AnimatedPositionedDirectional], which adapts to the ambient
@@ -860,6 +888,10 @@
/// frame of the animation, whereas [AnimatedPositionedDirectional] will trigger
/// a relayout as well. ([SlideTransition] is also text-direction-aware.)
///
+/// Here's an illustration of what using this widget looks like, using a [curve]
+/// of [Curves.fastOutSlowIn].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_positioned_directional.mp4}
+///
/// See also:
///
/// * [AnimatedPositioned], which specifies the widget's position visually (the
@@ -982,6 +1014,10 @@
/// Animating an opacity is relatively expensive because it requires painting
/// the child into an intermediate buffer.
///
+/// Here's an illustration of what using this widget looks like, using a [curve]
+/// of [Curves.fastOutSlowIn].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_opacity.mp4}
+///
/// ## Sample code
///
/// ```dart
@@ -1016,6 +1052,11 @@
/// }
/// }
/// ```
+///
+/// See also:
+///
+/// * [FadeTransition], an explicitly animated version of this widget, where
+/// an [Animation] is provided by the caller instead of being built in.
class AnimatedOpacity extends ImplicitlyAnimatedWidget {
/// Creates a widget that animates its opacity implicitly.
///
@@ -1083,6 +1124,10 @@
///
/// The [textAlign], [softWrap], [textOverflow], and [maxLines] properties are
/// not animated and take effect immediately when changed.
+///
+/// Here's an illustration of what using this widget looks like, using a [curve]
+/// of [Curves.elasticInOut].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_default_text_style.mp4}
class AnimatedDefaultTextStyle extends ImplicitlyAnimatedWidget {
/// Creates a widget that animates the default text style implicitly.
///
@@ -1186,6 +1231,10 @@
/// because it is being driven by an [AnimatedTheme]).
///
/// The [shape] is not animated.
+///
+/// Here's an illustration of what using this widget looks like, using a [curve]
+/// of [Curves.fastOutSlowIn].
+/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_physical_model.mp4}
class AnimatedPhysicalModel extends ImplicitlyAnimatedWidget {
/// Creates a widget that animates the properties of a [PhysicalModel].
///