Move newton into package:flutter (#3585)
Rather that importing `package:newton/newton.dart` you can
`import package:flutter/physics.dart`.
Fixes #2441
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 41442a8..7a64110 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -78,9 +78,9 @@
Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree/master/packages/flutter_test) which provides flutter-specific extensions on top of [package:test](https://pub.dartlang.org/packages/test).
-`flutter test` runs tests inside the flutter shell. Some packages inside the flutter repository can be run inside the dart command line VM as well as the flutter shell, `packages/newton` and `packages/flutter_tools` are two such examples:
+`flutter test` runs tests inside the flutter shell. Some packages inside the flutter repository can be run inside the dart command line VM as well as the flutter shell, `packages/flutter_tools` is one such examples:
- * `cd packages/newton`
+ * `cd packages/flutter_tools`
* `pub run test`
`flutter test --flutter-repo` is a shortcut for those working on the flutter repository itself which runs all tests inside the `flutter` package regardless of the current working directory.
diff --git a/packages/flutter/lib/animation.dart b/packages/flutter/lib/animation.dart
index 9c22eb8..5ff4ca2 100644
--- a/packages/flutter/lib/animation.dart
+++ b/packages/flutter/lib/animation.dart
@@ -3,12 +3,12 @@
// found in the LICENSE file.
/// The Flutter animation system.
-///
+///
/// To use, import `package:flutter/animation.dart`.
///
/// See [flutter.io/animations](https://flutter.io/animations/) for an overview.
///
-/// This library depends only on core Dart libraries and the `newton` package.
+/// This library depends only on core Dart libraries and the `physics.dart` library.
library animation;
export 'src/animation/animation.dart';
diff --git a/packages/flutter/lib/physics.dart b/packages/flutter/lib/physics.dart
new file mode 100644
index 0000000..78e7cd1
--- /dev/null
+++ b/packages/flutter/lib/physics.dart
@@ -0,0 +1,19 @@
+// Copyright 2016 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.
+
+/// Simple one-dimensional physics simulations, such as springs, friction, and
+/// gravity, for use in user interface animations.
+///
+/// To use, import `package:flutter/physics.dart`.
+library physics;
+
+export 'src/physics/clamped_simulation.dart';
+export 'src/physics/friction_simulation.dart';
+export 'src/physics/gravity_simulation.dart';
+export 'src/physics/scroll_simulation.dart';
+export 'src/physics/simulation_group.dart';
+export 'src/physics/simulation.dart';
+export 'src/physics/spring_simulation.dart';
+export 'src/physics/tolerance.dart';
+export 'src/physics/utils.dart';
diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart
index 0d42ec2..94b9810 100644
--- a/packages/flutter/lib/src/animation/animation_controller.dart
+++ b/packages/flutter/lib/src/animation/animation_controller.dart
@@ -6,7 +6,7 @@
import 'dart:ui' as ui show lerpDouble;
import 'package:flutter/scheduler.dart';
-import 'package:newton/newton.dart';
+import 'package:flutter/physics.dart';
import 'animation.dart';
import 'curves.dart';
diff --git a/packages/flutter/lib/src/animation/forces.dart b/packages/flutter/lib/src/animation/forces.dart
index 977bd40..e53c704 100644
--- a/packages/flutter/lib/src/animation/forces.dart
+++ b/packages/flutter/lib/src/animation/forces.dart
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'package:newton/newton.dart';
+import 'package:flutter/physics.dart';
-export 'package:newton/newton.dart' show SpringDescription;
+export 'package:flutter/physics.dart' show SpringDescription;
/// A factory for simulations.
abstract class Force {
diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart
index 830c6bf..5137b6f 100644
--- a/packages/flutter/lib/src/material/tabs.dart
+++ b/packages/flutter/lib/src/material/tabs.dart
@@ -5,7 +5,7 @@
import 'dart:async';
import 'dart:math' as math;
-import 'package:newton/newton.dart';
+import 'package:flutter/physics.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
diff --git a/packages/newton/lib/src/clamped_simulation.dart b/packages/flutter/lib/src/physics/clamped_simulation.dart
similarity index 100%
rename from packages/newton/lib/src/clamped_simulation.dart
rename to packages/flutter/lib/src/physics/clamped_simulation.dart
diff --git a/packages/newton/lib/src/friction_simulation.dart b/packages/flutter/lib/src/physics/friction_simulation.dart
similarity index 100%
rename from packages/newton/lib/src/friction_simulation.dart
rename to packages/flutter/lib/src/physics/friction_simulation.dart
diff --git a/packages/newton/lib/src/gravity_simulation.dart b/packages/flutter/lib/src/physics/gravity_simulation.dart
similarity index 100%
rename from packages/newton/lib/src/gravity_simulation.dart
rename to packages/flutter/lib/src/physics/gravity_simulation.dart
diff --git a/packages/newton/lib/src/scroll_simulation.dart b/packages/flutter/lib/src/physics/scroll_simulation.dart
similarity index 100%
rename from packages/newton/lib/src/scroll_simulation.dart
rename to packages/flutter/lib/src/physics/scroll_simulation.dart
diff --git a/packages/newton/lib/src/simulation.dart b/packages/flutter/lib/src/physics/simulation.dart
similarity index 100%
rename from packages/newton/lib/src/simulation.dart
rename to packages/flutter/lib/src/physics/simulation.dart
diff --git a/packages/newton/lib/src/simulation_group.dart b/packages/flutter/lib/src/physics/simulation_group.dart
similarity index 100%
rename from packages/newton/lib/src/simulation_group.dart
rename to packages/flutter/lib/src/physics/simulation_group.dart
diff --git a/packages/newton/lib/src/spring_simulation.dart b/packages/flutter/lib/src/physics/spring_simulation.dart
similarity index 100%
rename from packages/newton/lib/src/spring_simulation.dart
rename to packages/flutter/lib/src/physics/spring_simulation.dart
diff --git a/packages/newton/lib/src/tolerance.dart b/packages/flutter/lib/src/physics/tolerance.dart
similarity index 100%
rename from packages/newton/lib/src/tolerance.dart
rename to packages/flutter/lib/src/physics/tolerance.dart
diff --git a/packages/newton/lib/src/utils.dart b/packages/flutter/lib/src/physics/utils.dart
similarity index 100%
rename from packages/newton/lib/src/utils.dart
rename to packages/flutter/lib/src/physics/utils.dart
diff --git a/packages/flutter/lib/src/widgets/scroll_behavior.dart b/packages/flutter/lib/src/widgets/scroll_behavior.dart
index 346648c..da96072 100644
--- a/packages/flutter/lib/src/widgets/scroll_behavior.dart
+++ b/packages/flutter/lib/src/widgets/scroll_behavior.dart
@@ -4,7 +4,7 @@
import 'dart:math' as math;
-import 'package:newton/newton.dart';
+import 'package:flutter/physics.dart';
const double _kSecondsPerMillisecond = 1000.0;
const double _kScrollDrag = 0.025;
diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart
index 12541c4..4b136fd 100644
--- a/packages/flutter/lib/src/widgets/scrollable.dart
+++ b/packages/flutter/lib/src/widgets/scrollable.dart
@@ -6,7 +6,7 @@
import 'dart:math' as math;
import 'dart:ui' as ui show window;
-import 'package:newton/newton.dart';
+import 'package:flutter/physics.dart';
import 'package:flutter/gestures.dart';
import 'package:meta/meta.dart';
diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml
index ec56add..ffcdf46 100644
--- a/packages/flutter/pubspec.yaml
+++ b/packages/flutter/pubspec.yaml
@@ -21,8 +21,6 @@
cassowary:
path: ../cassowary
- newton:
- path: ../newton
dev_dependencies:
flutter_test:
diff --git a/packages/newton/test/near_equal_test.dart b/packages/flutter/test/physics/near_equal_test.dart
similarity index 91%
rename from packages/newton/test/near_equal_test.dart
rename to packages/flutter/test/physics/near_equal_test.dart
index f584280..4dd45f2 100644
--- a/packages/newton/test/near_equal_test.dart
+++ b/packages/flutter/test/physics/near_equal_test.dart
@@ -4,7 +4,7 @@
import 'package:test/test.dart';
-import 'package:newton/newton.dart';
+import 'package:flutter/physics.dart';
void main() {
test('test_friction', () {
diff --git a/packages/newton/test/newton_test.dart b/packages/flutter/test/physics/newton_test.dart
similarity index 99%
rename from packages/newton/test/newton_test.dart
rename to packages/flutter/test/physics/newton_test.dart
index 75d3ba0..96aec9a 100644
--- a/packages/newton/test/newton_test.dart
+++ b/packages/flutter/test/physics/newton_test.dart
@@ -4,7 +4,7 @@
import 'package:test/test.dart';
-import 'package:newton/newton.dart';
+import 'package:flutter/physics.dart';
void main() {
test('test_friction', () {
diff --git a/packages/newton/README.md b/packages/newton/README.md
deleted file mode 100644
index bb114b0..0000000
--- a/packages/newton/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Newton
-
-Simple Physics Simulations for Dart. Springs, friction, gravity, etc.
-
-To run the tests:
-
-- pub get
-- pub run test
diff --git a/packages/newton/lib/newton.dart b/packages/newton/lib/newton.dart
deleted file mode 100644
index 07899fc..0000000
--- a/packages/newton/lib/newton.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 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.
-
-/// Simple one-dimensional physics simulations, such as springs, friction, and
-/// gravity, for use in user interface animations.
-///
-/// This library is not meant to be imported by developers.
-/// It will soon be integrated into another Flutter library.
-library newton;
-
-export 'src/clamped_simulation.dart';
-export 'src/friction_simulation.dart';
-export 'src/gravity_simulation.dart';
-export 'src/scroll_simulation.dart';
-export 'src/simulation_group.dart';
-export 'src/simulation.dart';
-export 'src/spring_simulation.dart';
-export 'src/tolerance.dart';
-export 'src/utils.dart';
diff --git a/packages/newton/pubspec.yaml b/packages/newton/pubspec.yaml
deleted file mode 100644
index 4c27dd1..0000000
--- a/packages/newton/pubspec.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: newton
-description: Simple Physics Simulations for Dart
-version: 0.1.5
-author: Flutter Authors <flutter-dev@googlegroups.com>
-homepage: https://github.com/flutter/flutter/tree/master/packages/newton
-environment:
- sdk: '>=1.0.0 <2.0.0'
-dev_dependencies:
- flutter_test:
- path: ../flutter_test
diff --git a/packages/newton/test/all.dart b/packages/newton/test/all.dart
deleted file mode 100644
index 84523ac..0000000
--- a/packages/newton/test/all.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2016 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 'near_equal_test.dart' as near_equal_test;
-import 'newton_test.dart' as newton_test;
-
-void main() {
- near_equal_test.main();
- newton_test.main();
-}
diff --git a/travis/test.sh b/travis/test.sh
index 707a09c..f9cd537 100755
--- a/travis/test.sh
+++ b/travis/test.sh
@@ -17,7 +17,6 @@
(cd packages/flutter_test; flutter test)
(cd packages/flutter_tools; dart -c test/all.dart)
(cd packages/flx; dart -c test/all.dart)
-(cd packages/newton; dart -c test/all.dart)
(cd dev/manual_tests; flutter test)
(cd examples/hello_world; flutter test)