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
a07219a3
Unverified
Commit
a07219a3
authored
Jul 23, 2020
by
Alexandre Ardhuin
Committed by
GitHub
Jul 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate physics to nullsafety (#61941)
parent
b50b5ead
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6 additions
and
22 deletions
+6
-22
physics.dart
packages/flutter/lib/physics.dart
+0
-2
clamped_simulation.dart
packages/flutter/lib/src/physics/clamped_simulation.dart
+0
-2
friction_simulation.dart
packages/flutter/lib/src/physics/friction_simulation.dart
+0
-2
gravity_simulation.dart
packages/flutter/lib/src/physics/gravity_simulation.dart
+0
-2
simulation.dart
packages/flutter/lib/src/physics/simulation.dart
+0
-2
spring_simulation.dart
packages/flutter/lib/src/physics/spring_simulation.dart
+5
-7
tolerance.dart
packages/flutter/lib/src/physics/tolerance.dart
+0
-2
utils.dart
packages/flutter/lib/src/physics/utils.dart
+1
-3
No files found.
packages/flutter/lib/physics.dart
View file @
a07219a3
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// 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.
// @dart = 2.8
/// Simple one-dimensional physics simulations, such as springs, friction, and
/// Simple one-dimensional physics simulations, such as springs, friction, and
/// gravity, for use in user interface animations.
/// gravity, for use in user interface animations.
///
///
...
...
packages/flutter/lib/src/physics/clamped_simulation.dart
View file @
a07219a3
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// 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.
// @dart = 2.8
import
'simulation.dart'
;
import
'simulation.dart'
;
/// A simulation that applies limits to another simulation.
/// A simulation that applies limits to another simulation.
...
...
packages/flutter/lib/src/physics/friction_simulation.dart
View file @
a07219a3
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// 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.
// @dart = 2.8
import
'dart:math'
as
math
;
import
'dart:math'
as
math
;
import
'simulation.dart'
;
import
'simulation.dart'
;
...
...
packages/flutter/lib/src/physics/gravity_simulation.dart
View file @
a07219a3
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// 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.
// @dart = 2.8
import
'simulation.dart'
;
import
'simulation.dart'
;
// Examples can assume:
// Examples can assume:
...
...
packages/flutter/lib/src/physics/simulation.dart
View file @
a07219a3
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// 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.
// @dart = 2.8
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'tolerance.dart'
;
import
'tolerance.dart'
;
...
...
packages/flutter/lib/src/physics/spring_simulation.dart
View file @
a07219a3
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// 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.
// @dart = 2.8
import
'dart:math'
as
math
;
import
'dart:math'
as
math
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
...
@@ -20,9 +18,9 @@ class SpringDescription {
...
@@ -20,9 +18,9 @@ class SpringDescription {
///
///
/// See [mass], [stiffness], and [damping] for the units of the arguments.
/// See [mass], [stiffness], and [damping] for the units of the arguments.
const
SpringDescription
({
const
SpringDescription
({
this
.
mass
,
required
this
.
mass
,
this
.
stiffness
,
required
this
.
stiffness
,
this
.
damping
,
required
this
.
damping
,
});
});
/// Creates a spring given the mass (m), stiffness (k), and damping ratio (ζ).
/// Creates a spring given the mass (m), stiffness (k), and damping ratio (ζ).
...
@@ -33,8 +31,8 @@ class SpringDescription {
...
@@ -33,8 +31,8 @@ class SpringDescription {
/// See [mass] and [stiffness] for the units for those arguments. The damping
/// See [mass] and [stiffness] for the units for those arguments. The damping
/// ratio is unitless.
/// ratio is unitless.
SpringDescription
.
withDampingRatio
({
SpringDescription
.
withDampingRatio
({
this
.
mass
,
required
this
.
mass
,
this
.
stiffness
,
required
this
.
stiffness
,
double
ratio
=
1.0
,
double
ratio
=
1.0
,
})
:
damping
=
ratio
*
2.0
*
math
.
sqrt
(
mass
*
stiffness
);
})
:
damping
=
ratio
*
2.0
*
math
.
sqrt
(
mass
*
stiffness
);
...
...
packages/flutter/lib/src/physics/tolerance.dart
View file @
a07219a3
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// 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.
// @dart = 2.8
/// Structure that specifies maximum allowable magnitudes for distances,
/// Structure that specifies maximum allowable magnitudes for distances,
/// durations, and velocity differences to be considered equal.
/// durations, and velocity differences to be considered equal.
class
Tolerance
{
class
Tolerance
{
...
...
packages/flutter/lib/src/physics/utils.dart
View file @
a07219a3
...
@@ -2,14 +2,12 @@
...
@@ -2,14 +2,12 @@
// 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.
// @dart = 2.8
/// Whether two doubles are within a given distance of each other.
/// Whether two doubles are within a given distance of each other.
///
///
/// The `epsilon` argument must be positive and not null.
/// The `epsilon` argument must be positive and not null.
/// The `a` and `b` arguments may be null. A null value is only considered
/// The `a` and `b` arguments may be null. A null value is only considered
/// near-equal to another null value.
/// near-equal to another null value.
bool
nearEqual
(
double
a
,
double
b
,
double
epsilon
)
{
bool
nearEqual
(
double
?
a
,
double
?
b
,
double
epsilon
)
{
assert
(
epsilon
!=
null
);
assert
(
epsilon
!=
null
);
assert
(
epsilon
>=
0.0
);
assert
(
epsilon
>=
0.0
);
if
(
a
==
null
||
b
==
null
)
if
(
a
==
null
||
b
==
null
)
...
...
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