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
5ccd4f34
Unverified
Commit
5ccd4f34
authored
Nov 27, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Nov 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implicit-casts:false in flutter/lib/src/physics (#45622)
parent
37f9c541
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
clamped_simulation.dart
packages/flutter/lib/src/physics/clamped_simulation.dart
+2
-2
friction_simulation.dart
packages/flutter/lib/src/physics/friction_simulation.dart
+2
-2
spring_simulation.dart
packages/flutter/lib/src/physics/spring_simulation.dart
+3
-3
No files found.
packages/flutter/lib/src/physics/clamped_simulation.dart
View file @
5ccd4f34
...
...
@@ -48,10 +48,10 @@ class ClampedSimulation extends Simulation {
final
double
dxMax
;
@override
double
x
(
double
time
)
=>
simulation
.
x
(
time
).
clamp
(
xMin
,
xMax
);
double
x
(
double
time
)
=>
simulation
.
x
(
time
).
clamp
(
xMin
,
xMax
)
as
double
;
@override
double
dx
(
double
time
)
=>
simulation
.
dx
(
time
).
clamp
(
dxMin
,
dxMax
);
double
dx
(
double
time
)
=>
simulation
.
dx
(
time
).
clamp
(
dxMin
,
dxMax
)
as
double
;
@override
bool
isDone
(
double
time
)
=>
simulation
.
isDone
(
time
);
...
...
packages/flutter/lib/src/physics/friction_simulation.dart
View file @
5ccd4f34
...
...
@@ -65,7 +65,7 @@ class FrictionSimulation extends Simulation {
// Solving for D given x(time) is trickier. Algebra courtesy of Wolfram Alpha:
// x1 = x0 + (v0 * D^((log(v1) - log(v0)) / log(D))) / log(D) - v0 / log(D), find D
static
double
_dragFor
(
double
startPosition
,
double
endPosition
,
double
startVelocity
,
double
endVelocity
)
{
return
math
.
pow
(
math
.
e
,
(
startVelocity
-
endVelocity
)
/
(
startPosition
-
endPosition
));
return
math
.
pow
(
math
.
e
,
(
startVelocity
-
endVelocity
)
/
(
startPosition
-
endPosition
))
as
double
;
}
@override
...
...
@@ -116,7 +116,7 @@ class BoundedFrictionSimulation extends FrictionSimulation {
@override
double
x
(
double
time
)
{
return
super
.
x
(
time
).
clamp
(
_minX
,
_maxX
);
return
super
.
x
(
time
).
clamp
(
_minX
,
_maxX
)
as
double
;
}
@override
...
...
packages/flutter/lib/src/physics/spring_simulation.dart
View file @
5ccd4f34
...
...
@@ -196,7 +196,7 @@ class _CriticalSolution implements _SpringSolution {
@override
double
dx
(
double
time
)
{
final
double
power
=
math
.
pow
(
math
.
e
,
_r
*
time
);
final
double
power
=
math
.
pow
(
math
.
e
,
_r
*
time
)
as
double
;
return
_r
*
(
_c1
+
_c2
*
time
)
*
power
+
_c2
*
power
;
}
...
...
@@ -266,13 +266,13 @@ class _UnderdampedSolution implements _SpringSolution {
@override
double
x
(
double
time
)
{
return
math
.
pow
(
math
.
e
,
_r
*
tim
e
)
*
return
(
math
.
pow
(
math
.
e
,
_r
*
time
)
as
doubl
e
)
*
(
_c1
*
math
.
cos
(
_w
*
time
)
+
_c2
*
math
.
sin
(
_w
*
time
));
}
@override
double
dx
(
double
time
)
{
final
double
power
=
math
.
pow
(
math
.
e
,
_r
*
time
);
final
double
power
=
math
.
pow
(
math
.
e
,
_r
*
time
)
as
double
;
final
double
cosine
=
math
.
cos
(
_w
*
time
);
final
double
sine
=
math
.
sin
(
_w
*
time
);
return
power
*
(
_c2
*
_w
*
cosine
-
_c1
*
_w
*
sine
)
+
...
...
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