From 33997bb7bb8aa7fb0081e46af46d6954174bae01 Mon Sep 17 00:00:00 2001 From: xster Date: Fri, 7 Apr 2017 18:40:06 -0700 Subject: [PATCH] Add some more details to implicit animation's dartdoc (#9292) --- .../lib/src/widgets/implicit_animations.dart | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index dad3ee6ef6..8264788650 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -79,6 +79,11 @@ class TextStyleTween extends Tween { /// An abstract widget for building widgets that gradually change their /// values over a period of time. +/// +/// Subclasses' States must provide a way to visit the subclass's relevant +/// fields to animate. [ImplicitlyAnimatedWidget] will then automatically +/// interpolate and animate those fields using the provided duration and +/// curve when those fields change. abstract class ImplicitlyAnimatedWidget extends StatefulWidget { /// Initializes fields for subclasses. /// @@ -118,6 +123,10 @@ typedef Tween TweenConstructor(T targetValue); typedef Tween TweenVisitor(Tween tween, T targetValue, TweenConstructor constructor); /// A base class for widgets with implicit animations. +/// +/// Subclasses must implement the [forEachTween] method to help +/// [AnimatedWidgetBaseState] iterate through the subclasses' widget's fields +/// and animate them. abstract class AnimatedWidgetBaseState extends State with SingleTickerProviderStateMixin { AnimationController _controller; @@ -217,12 +226,14 @@ abstract class AnimatedWidgetBaseState exten /// A container that gradually changes its values over a period of time. /// +/// The [AnimatedContainer] will automatically animate between the old and +/// new values of properties when they change using the provided curve and +/// duration. Properties that are null are not animated. +/// /// This class is useful for generating simple implicit transitions between -/// different parameters to [Container]. For more complex animations, you'll -/// likely want to use a subclass of [Transition] or use an -/// [AnimationController] yourself. -/// -/// Properties that are null are not animated. +/// different parameters to [Container] with its internal +/// [AnimationController]. For more complex animations, you'll likely want to +/// use a subclass of [Transition] or use your own [AnimationController]. class AnimatedContainer extends ImplicitlyAnimatedWidget { /// Creates a container that animates its parameters implicitly. ///