From ec5c2e3e0cc9304daff08d06b32e5e59f0a599c2 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Thu, 30 Aug 2018 10:09:22 -0700 Subject: [PATCH] Add links to implicit animation illustrations. (#21092) This adds links to the already existing animated diagrams in the asset-for-api-docs repo. --- packages/flutter/lib/src/material/theme.dart | 4 ++ .../lib/src/widgets/implicit_animations.dart | 49 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/packages/flutter/lib/src/material/theme.dart b/packages/flutter/lib/src/material/theme.dart index 5a16304c17..cebb86b043 100644 --- a/packages/flutter/lib/src/material/theme.dart +++ b/packages/flutter/lib/src/material/theme.dart @@ -191,6 +191,10 @@ class ThemeDataTween extends Tween { /// 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 22ba326baf..7c86e4ae30 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -404,11 +404,20 @@ abstract class AnimatedWidgetBaseState exten /// [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 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState /// 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 @@ class _AnimatedPaddingState extends AnimatedWidgetBaseState { /// 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 @@ class _AnimatedAlignState extends AnimatedWidgetBaseState { /// 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 @@ class _AnimatedPositionedState extends AnimatedWidgetBaseState