Skip to content

docs: Add new 'Animating widgets' how-to guide.#283

Closed
qchong wants to merge 1 commit into
flutter:masterfrom
qchong:animation_howto
Closed

docs: Add new 'Animating widgets' how-to guide.#283
qchong wants to merge 1 commit into
flutter:masterfrom
qchong:animation_howto

Conversation

@qchong

@qchong qchong commented Sep 29, 2016

Copy link
Copy Markdown
Contributor

Staged preview:

@abarth @HansMuller ptal.

output: web

- title: Animate Widgets
url: /animating-widgets/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the title and URL should match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The titles in the sidebar (left-nav) are shortened by design, to make them easier to scan. The full title ('Animating Widgets') is shown when users open the link to that page.

Comment thread animating-widgets.md
available.

The [`flutter/animation`](https://docs.flutter.io/flutter/animation/animation-library.html)
package in the Flutter SDK provides APIs to create animation effects in user

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically animation is a library rather than a package.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to "library".

Comment thread animating-widgets.md
time) as it runs.

Based on the animation object’s properties at a specific frame, Flutter
dynamically modifies your widget visual appearence, and rebuilds the widget

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

widget's visual appearance

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread animating-widgets.md
To learn more about
using the other key classes in the
[`flutter/animation`](https://docs.flutter.io/flutter/animation/animation-library.html)
package, see the [Animations in Flutter](/animations) guide.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/package/library/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread animating-widgets.md

To render your widget with an animation, set one or more of the widget’s
members to the animation object, then use the animation’s value to decide how
to draw your object.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

draw is kind of an unusual case. It's much more common to use the animation's value to decide how to build child widgets.

Comment thread animations.md
You can also specify a progression between two colors. For example:

```dart
final Tween colorTween =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd drop the final from all these example. Here I'd use the more specific ColorTween type.

Comment thread animations.md
interpolates between the double values of -200.0 to 0.0.

```dart
final Tween doubleTween = new Tween<double>(begin: -200.0, end: 0.0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping the type parameter here is dodgy. Better to keep it in.

Comment thread animations.md
new ColorTween(begin: Colors.transparent, end: Colors.black54);
```

To apply a Tween to a given animation object, use the [`animate()`]()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra ()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread animations.md

Animation<int> alpha = new IntTween(
begin: 0,
end: 255)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whitespace is odd. I'd just put it all on one line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread animations.md
useful for widgets that are already listening to the animation and hence
rebuilding whenever the animation changes value.
+ [`animate()`](http://docs.flutter.io/flutter/animation/Animatable/animate.html)
Animates the tween based on the animation object's properties. Rather than

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indent between these two bullets.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread animating-widgets.md
height: animation.value,
width: animation.value,
child: new AssetImage(
name: 'assets/flutter_logo.png',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these changed from web-based images to local images? With web-based images, readers can copy and paste the examples and they'll work. With local examples, readers have to create a project with the directory structure exactly right, and get the flutter.yaml file right, none of which is shown here. This was identified during usability testing of the original examples.

@qchong

qchong commented Nov 4, 2016

Copy link
Copy Markdown
Contributor Author

This PR has a dependency on flutter/flutter#1322 for improved animation code samples.

@eseidelGoogle

Copy link
Copy Markdown
Contributor

@sethladd maybe you can find a new owner for this?

@sethladd

sethladd commented Feb 9, 2017

Copy link
Copy Markdown
Contributor

Closing as stale. We can reopen if a new owner is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants