From abf23783c1d5dc3de6db2751f0d080816f76df20 Mon Sep 17 00:00:00 2001 From: DevKage <33748002+ufrshubham@users.noreply.github.com> Date: Wed, 13 Mar 2024 19:28:25 +0530 Subject: [PATCH] refactor!: Un-export `Timer` (#90) This PR removes the internal `Timer` class from the exports. It is a very simple wrapper over the `Stopwatch` API and does not provide any additional functionality. But it does causes conflicts when try to use Flame's `Timer` or dart:async's `Timer`. By not exporting it, we can save the users from these conflicts. --- packages/forge2d/example/web/demo.dart | 2 +- packages/forge2d/lib/src/common.dart | 1 - packages/forge2d/lib/src/dynamics/world.dart | 1 + packages/forge2d/pubspec.yaml | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/forge2d/example/web/demo.dart b/packages/forge2d/example/web/demo.dart index 6edfadee..a1168618 100644 --- a/packages/forge2d/example/web/demo.dart +++ b/packages/forge2d/example/web/demo.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:html' hide Body; -import 'package:forge2d/forge2d_browser.dart' hide Timer; +import 'package:forge2d/forge2d_browser.dart'; /// An abstract class for any Demo of the Forge2D library. abstract class Demo { diff --git a/packages/forge2d/lib/src/common.dart b/packages/forge2d/lib/src/common.dart index 48a9ea41..12d75c34 100644 --- a/packages/forge2d/lib/src/common.dart +++ b/packages/forge2d/lib/src/common.dart @@ -2,6 +2,5 @@ export 'common/color3i.dart'; export 'common/raycast_result.dart'; export 'common/rot.dart'; export 'common/sweep.dart'; -export 'common/timer.dart'; export 'common/transform.dart'; export 'common/viewport_transform.dart'; diff --git a/packages/forge2d/lib/src/dynamics/world.dart b/packages/forge2d/lib/src/dynamics/world.dart index 9a8b11f8..5e566bfe 100644 --- a/packages/forge2d/lib/src/dynamics/world.dart +++ b/packages/forge2d/lib/src/dynamics/world.dart @@ -5,6 +5,7 @@ import 'dart:math'; import 'package:forge2d/forge2d.dart'; +import 'package:forge2d/src/common/timer.dart'; import 'package:forge2d/src/settings.dart' as settings; /// The world class manages all physics entities, dynamic simulation, and diff --git a/packages/forge2d/pubspec.yaml b/packages/forge2d/pubspec.yaml index 6dca198e..faddbd27 100644 --- a/packages/forge2d/pubspec.yaml +++ b/packages/forge2d/pubspec.yaml @@ -7,11 +7,11 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - meta: ^1.9.1 + meta: ^1.11.0 vector_math: ^2.1.4 dev_dependencies: dartdoc: ^7.0.2 flame_lint: ^1.1.1 mocktail: ^1.0.1 - test: any + test: ^1.24.9