1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/animation.dart';
import 'package:flutter/painting.dart';
/// An interpolation between two fractional offsets.
///
/// This class specializes the interpolation of [Tween<FractionalOffset>] to be
/// appropriate for fractional offsets.
///
/// See [Tween] for a discussion on how to use interpolation objects.
///
/// See also:
///
/// * [AlignmentTween], which interpolates between to [Alignment] objects.
class FractionalOffsetTween extends Tween<FractionalOffset> {
/// Creates a fractional offset tween.
///
/// The [begin] and [end] properties may be null; the null value
/// is treated as meaning the center.
FractionalOffsetTween({ FractionalOffset begin, FractionalOffset end })
: super(begin: begin, end: end);
/// Returns the value this variable has at the given animation clock value.
@override
FractionalOffset lerp(double t) => FractionalOffset.lerp(begin, end, t);
}
/// An interpolation between two alignments.
///
/// This class specializes the interpolation of [Tween<Alignment>] to be
/// appropriate for alignments.
///
/// See [Tween] for a discussion on how to use interpolation objects.
///
/// See also:
///
/// * [AlignmentGeometryTween], which interpolates between two
/// [AlignmentGeometry] objects.
class AlignmentTween extends Tween<Alignment> {
/// Creates a fractional offset tween.
///
/// The [begin] and [end] properties may be null; the null value
/// is treated as meaning the center.
AlignmentTween({ Alignment begin, Alignment end })
: super(begin: begin, end: end);
/// Returns the value this variable has at the given animation clock value.
@override
Alignment lerp(double t) => Alignment.lerp(begin, end, t);
}
/// An interpolation between two [AlignmentGeometry].
///
/// This class specializes the interpolation of [Tween<AlignmentGeometry>]
/// to be appropriate for alignments.
///
/// See [Tween] for a discussion on how to use interpolation objects.
///
/// See also:
///
/// * [AlignmentTween], which interpolates between two [Alignment] objects.
class AlignmentGeometryTween extends Tween<AlignmentGeometry> {
/// Creates a fractional offset geometry tween.
///
/// The [begin] and [end] properties may be null; the null value
/// is treated as meaning the center.
AlignmentGeometryTween({
AlignmentGeometry begin,
AlignmentGeometry end,
}) : super(begin: begin, end: end);
/// Returns the value this variable has at the given animation clock value.
@override
AlignmentGeometry lerp(double t) => AlignmentGeometry.lerp(begin, end, t);
}