Unverified Commit 77bbd28c authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Random trivial fixes in the animation packages (#30276)

parent 3c8dabef
......@@ -44,7 +44,7 @@ const Tolerance _kFlingTolerance = Tolerance(
/// Configures how an [AnimationController] behaves when animations are disabled.
///
/// When [AccessibilityFeatures.disableAnimations] is true, the device is asking
/// flutter to reduce or disable animations as much as possible. To honor this,
/// Flutter to reduce or disable animations as much as possible. To honor this,
/// we reduce the duration and the corresponding number of frames for animations.
/// This enum is used to allow certain [AnimationController]s to opt out of this
/// behavior.
......@@ -209,7 +209,7 @@ class AnimationController extends Animation<double>
with AnimationEagerListenerMixin, AnimationLocalListenersMixin, AnimationLocalStatusListenersMixin {
/// Creates an animation controller.
///
/// * [value] is the initial value of the animation. If defaults to the lower
/// * `value` is the initial value of the animation. If defaults to the lower
/// bound.
///
/// * [duration] is the length of time this animation should last.
......@@ -524,11 +524,10 @@ class AnimationController extends Animation<double>
return _animateToInternal(target, duration: duration, curve: curve);
}
TickerFuture _animateToInternal(double target, { Duration duration, Curve curve = Curves.linear, AnimationBehavior animationBehavior }) {
final AnimationBehavior behavior = animationBehavior ?? this.animationBehavior;
TickerFuture _animateToInternal(double target, { Duration duration, Curve curve = Curves.linear }) {
double scale = 1.0;
if (SemanticsBinding.instance.disableAnimations) {
switch (behavior) {
switch (animationBehavior) {
case AnimationBehavior.normal:
// Since the framework cannot handle zero duration animations, we run it at 5% of the normal
// duration to limit most animations to a single frame.
......
......@@ -111,8 +111,8 @@ class SawTooth extends Curve {
}
}
/// A curve that is 0.0 until [begin], then curved (according to [curve] from
/// 0.0 to 1.0 at [end], then 1.0.
/// A curve that is 0.0 until [begin], then curved (according to [curve]) from
/// 0.0 at [begin] to 1.0 at [end], then remains 1.0 past [end].
///
/// An [Interval] can be used to delay an animation. For example, a six second
/// animation that uses an [Interval] with its [begin] set to 0.5 and its [end]
......
......@@ -7,17 +7,16 @@ import 'package:flutter/foundation.dart';
import 'animation.dart';
import 'tween.dart';
/// Enables creating an [Animation] whose value is defined by a
/// sequence of [Tween]s.
/// Enables creating an [Animation] whose value is defined by a sequence of
/// [Tween]s.
///
/// Each [TweenSequenceItem] has a weight that defines its percentage
/// of the animation's duration. Each tween defines the animation's value
/// during the interval indicated by its weight.
/// Each [TweenSequenceItem] has a weight that defines its percentage of the
/// animation's duration. Each tween defines the animation's value during the
/// interval indicated by its weight.
///
/// For example, to define an animation that uses an easing curve to
/// interpolate between 5.0 and 10.0 during the first 40% of the
/// animation, remain at 10.0 for the next 20%, and then return to
/// 10.0 for the final 40%:
/// For example, to define an animation that uses an easing curve to interpolate
/// between 5.0 and 10.0 during the first 40% of the animation, remain at 10.0
/// for the next 20%, and then return to 10.0 for the final 40%:
///
/// ```dart
/// final Animation<double> animation = TweenSequence(
......@@ -42,12 +41,11 @@ import 'tween.dart';
class TweenSequence<T> extends Animatable<T> {
/// Construct a TweenSequence.
///
/// The [items] parameter must be a list of one or more
/// [TweenSequenceItem]s.
/// The [items] parameter must be a list of one or more [TweenSequenceItem]s.
///
/// There's a small cost associated with building a `TweenSequence` so
/// it's best to reuse one, rather than rebuilding it on every frame,
/// when that's possible.
/// There's a small cost associated with building a `TweenSequence` so it's
/// best to reuse one, rather than rebuilding it on every frame, when that's
/// possible.
TweenSequence(List<TweenSequenceItem<T>> items)
: assert(items != null),
assert(items.isNotEmpty) {
......@@ -124,8 +122,8 @@ class TweenSequenceItem<T> {
/// An arbitrary value that indicates the relative percentage of a
/// [TweenSequence] animation's duration when [tween] will be used.
///
/// The percentage for an individual item is the item's weight divided
/// by the sum of all of the items' weights.
/// The percentage for an individual item is the item's weight divided by the
/// sum of all of the items' weights.
final double weight;
}
......
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