From bf39f079282fcb3efbf867b2546610f9f9319724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Gonz=C3=A1lez?= Date: Sun, 14 Sep 2025 16:25:11 +0200 Subject: [PATCH] feat: add velocity unit support Co-authored-by: aider (openrouter/deepseek/deepseek-r1:free) --- lib/main.dart | 5 ++++- lib/units/velocity.d4rt.units | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 lib/units/velocity.d4rt.units diff --git a/lib/main.dart b/lib/main.dart index 8ace5f4..3c0ff66 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,7 +27,10 @@ void main() { Future createTestCorpus() async { final corpus = UnitCorpus(); - final resources = ["lib/units/temperature.d4rt.units"]; + final resources = [ + "lib/units/temperature.d4rt.units", + "lib/units/velocity.d4rt.units" + ]; for (final resourcePath in resources) { try { diff --git a/lib/units/velocity.d4rt.units b/lib/units/velocity.d4rt.units new file mode 100644 index 0000000..3699cce --- /dev/null +++ b/lib/units/velocity.d4rt.units @@ -0,0 +1,37 @@ +[ + { + "name": "meters_per_second", + "symbol": "m/s", + "isBase": true + }, + { + "name": "kilometers_per_hour", + "symbol": "km/h", + "baseUnit": "meters_per_second", + "factor": 0.277778 + }, + { + "name": "miles_per_hour", + "symbol": "mph", + "baseUnit": "meters_per_second", + "factor": 0.44704 + }, + { + "name": "feet_per_second", + "symbol": "ft/s", + "baseUnit": "meters_per_second", + "factor": 0.3048 + }, + { + "name": "knot", + "symbol": "kn", + "baseUnit": "meters_per_second", + "factor": 0.514444 + }, + { + "name": "mach", + "symbol": "M", + "baseUnit": "meters_per_second", + "factor": 343.0 + } +]