Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a2c3f6c5
Unverified
Commit
a2c3f6c5
authored
Nov 26, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Nov 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implicit-casts:false in flutter/lib/src/animation (#45501)
parent
4055e196
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
animation.dart
packages/flutter/lib/src/animation/animation.dart
+1
-1
animation_controller.dart
packages/flutter/lib/src/animation/animation_controller.dart
+5
-5
curves.dart
packages/flutter/lib/src/animation/curves.dart
+4
-4
tween.dart
packages/flutter/lib/src/animation/tween.dart
+1
-1
No files found.
packages/flutter/lib/src/animation/animation.dart
View file @
a2c3f6c5
...
...
@@ -167,7 +167,7 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> {
@optionalTypeArgs
Animation
<
U
>
drive
<
U
>(
Animatable
<
U
>
child
)
{
assert
(
this
is
Animation
<
double
>);
return
child
.
animate
(
this
as
dynamic
);
// TODO(ianh): Clean this once https://github.com/dart-lang/sdk/issues/32120 is fixed.
return
child
.
animate
(
this
as
Animation
<
double
>);
}
@override
...
...
packages/flutter/lib/src/animation/animation_controller.dart
View file @
a2c3f6c5
...
...
@@ -392,7 +392,7 @@ class AnimationController extends Animation<double>
}
void
_internalSetValue
(
double
newValue
)
{
_value
=
newValue
.
clamp
(
lowerBound
,
upperBound
);
_value
=
newValue
.
clamp
(
lowerBound
,
upperBound
)
as
double
;
if
(
_value
==
lowerBound
)
{
_status
=
AnimationStatus
.
dismissed
;
}
else
if
(
_value
==
upperBound
)
{
...
...
@@ -576,7 +576,7 @@ class AnimationController extends Animation<double>
stop
();
if
(
simulationDuration
==
Duration
.
zero
)
{
if
(
value
!=
target
)
{
_value
=
target
.
clamp
(
lowerBound
,
upperBound
);
_value
=
target
.
clamp
(
lowerBound
,
upperBound
)
as
double
;
notifyListeners
();
}
_status
=
(
_direction
==
_AnimationDirection
.
forward
)
?
...
...
@@ -701,7 +701,7 @@ class AnimationController extends Animation<double>
assert
(!
isAnimating
);
_simulation
=
simulation
;
_lastElapsedDuration
=
Duration
.
zero
;
_value
=
simulation
.
x
(
0.0
).
clamp
(
lowerBound
,
upperBound
);
_value
=
simulation
.
x
(
0.0
).
clamp
(
lowerBound
,
upperBound
)
as
double
;
final
TickerFuture
result
=
_ticker
.
start
();
_status
=
(
_direction
==
_AnimationDirection
.
forward
)
?
AnimationStatus
.
forward
:
...
...
@@ -778,7 +778,7 @@ class AnimationController extends Animation<double>
_lastElapsedDuration
=
elapsed
;
final
double
elapsedInSeconds
=
elapsed
.
inMicroseconds
.
toDouble
()
/
Duration
.
microsecondsPerSecond
;
assert
(
elapsedInSeconds
>=
0.0
);
_value
=
_simulation
.
x
(
elapsedInSeconds
).
clamp
(
lowerBound
,
upperBound
);
_value
=
_simulation
.
x
(
elapsedInSeconds
).
clamp
(
lowerBound
,
upperBound
)
as
double
;
if
(
_simulation
.
isDone
(
elapsedInSeconds
))
{
_status
=
(
_direction
==
_AnimationDirection
.
forward
)
?
AnimationStatus
.
completed
:
...
...
@@ -813,7 +813,7 @@ class _InterpolationSimulation extends Simulation {
@override
double
x
(
double
timeInSeconds
)
{
final
double
t
=
(
timeInSeconds
/
_durationInSeconds
).
clamp
(
0.0
,
1.0
);
final
double
t
=
(
timeInSeconds
/
_durationInSeconds
).
clamp
(
0.0
,
1.0
)
as
double
;
if
(
t
==
0.0
)
return
_begin
;
else
if
(
t
==
1.0
)
...
...
packages/flutter/lib/src/animation/curves.dart
View file @
a2c3f6c5
...
...
@@ -149,7 +149,7 @@ class Interval extends Curve {
assert
(
end
>=
0.0
);
assert
(
end
<=
1.0
);
assert
(
end
>=
begin
);
t
=
((
t
-
begin
)
/
(
end
-
begin
)).
clamp
(
0.0
,
1.0
);
t
=
((
t
-
begin
)
/
(
end
-
begin
)).
clamp
(
0.0
,
1.0
)
as
double
;
if
(
t
==
0.0
||
t
==
1.0
)
return
t
;
return
curve
.
transform
(
t
);
...
...
@@ -400,7 +400,7 @@ class ElasticInCurve extends Curve {
double
transformInternal
(
double
t
)
{
final
double
s
=
period
/
4.0
;
t
=
t
-
1.0
;
return
-
math
.
pow
(
2.0
,
10.0
*
t
)
*
math
.
sin
((
t
-
s
)
*
(
math
.
pi
*
2.0
)
/
period
);
return
-
math
.
pow
(
2.0
,
10.0
*
t
)
*
math
.
sin
((
t
-
s
)
*
(
math
.
pi
*
2.0
)
/
period
)
as
double
;
}
@override
...
...
@@ -427,7 +427,7 @@ class ElasticOutCurve extends Curve {
@override
double
transformInternal
(
double
t
)
{
final
double
s
=
period
/
4.0
;
return
math
.
pow
(
2.0
,
-
10
*
t
)
*
math
.
sin
((
t
-
s
)
*
(
math
.
pi
*
2.0
)
/
period
)
+
1.0
;
return
math
.
pow
(
2.0
,
-
10
*
t
)
*
math
.
sin
((
t
-
s
)
*
(
math
.
pi
*
2.0
)
/
period
)
+
1.0
as
double
;
}
@override
...
...
@@ -459,7 +459,7 @@ class ElasticInOutCurve extends Curve {
if
(
t
<
0.0
)
return
-
0.5
*
math
.
pow
(
2.0
,
10.0
*
t
)
*
math
.
sin
((
t
-
s
)
*
(
math
.
pi
*
2.0
)
/
period
);
else
return
math
.
pow
(
2.0
,
-
10.0
*
t
)
*
math
.
sin
((
t
-
s
)
*
(
math
.
pi
*
2.0
)
/
period
)
*
0.5
+
1.0
;
return
math
.
pow
(
2.0
,
-
10.0
*
t
)
*
math
.
sin
((
t
-
s
)
*
(
math
.
pi
*
2.0
)
/
period
)
*
0.5
+
1.0
as
double
;
}
@override
...
...
packages/flutter/lib/src/animation/tween.dart
View file @
a2c3f6c5
...
...
@@ -236,7 +236,7 @@ class Tween<T extends dynamic> extends Animatable<T> {
T
lerp
(
double
t
)
{
assert
(
begin
!=
null
);
assert
(
end
!=
null
);
return
begin
+
(
end
-
begin
)
*
t
;
return
begin
+
(
end
-
begin
)
*
t
as
T
;
}
/// Returns the interpolated value for the current value of the given animation.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment