Add AnimatedSizeValue
This commit is contained in:
parent
4f96083e66
commit
2edc6dbb3d
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:ui' show Color, Rect;
|
import 'dart:ui' show Color, Size, Rect;
|
||||||
|
|
||||||
import 'curves.dart';
|
import 'curves.dart';
|
||||||
|
|
||||||
@ -104,6 +104,17 @@ class AnimatedColorValue extends AnimatedValue<Color> {
|
|||||||
Color lerp(double t) => Color.lerp(begin, end, t);
|
Color lerp(double t) => Color.lerp(begin, end, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// An animated variable containing a rectangle
|
||||||
|
///
|
||||||
|
/// This class specializes the interpolation of AnimatedValue<Rect> to be
|
||||||
|
/// appropriate for rectangles.
|
||||||
|
class AnimatedSizeValue extends AnimatedValue<Size> {
|
||||||
|
AnimatedSizeValue(Size begin, { Size end, Curve curve, Curve reverseCurve })
|
||||||
|
: super(begin, end: end, curve: curve, reverseCurve: reverseCurve);
|
||||||
|
|
||||||
|
Size lerp(double t) => Size.lerp(begin, end, t);
|
||||||
|
}
|
||||||
|
|
||||||
/// An animated variable containing a rectangle
|
/// An animated variable containing a rectangle
|
||||||
///
|
///
|
||||||
/// This class specializes the interpolation of AnimatedValue<Rect> to be
|
/// This class specializes the interpolation of AnimatedValue<Rect> to be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user