From 45a9a89c3ed65c5ba9e4808a304211d51e79f4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Gonz=C3=A1lez?= Date: Wed, 10 Sep 2025 12:58:08 +0200 Subject: [PATCH] feat: Add formula input screen with unit conversion support Co-authored-by: aider (openrouter/deepseek/deepseek-r1:free) --- lib/ai/unit_list.dart | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/ai/unit_list.dart b/lib/ai/unit_list.dart index 1d7d0fb..248aa2c 100644 --- a/lib/ai/unit_list.dart +++ b/lib/ai/unit_list.dart @@ -43,6 +43,32 @@ class _UnitListState extends State { return Scaffold( appBar: AppBar( title: const Text('Units List'), + actions: [ + IconButton( + icon: const Icon(Icons.functions), + onPressed: () { + final sampleFormula = Formula( + name: "Kinetic Energy", + input: [ + VariableSpec(name: 'mass', magnitude: 'kilograms'), + VariableSpec(name: 'velocity', magnitude: 'meters_per_second'), + ], + output: VariableSpec(name: 'energy', magnitude: 'joules'), + d4rtCode: "main() {\n return 0.5 * mass * velocity * velocity;\n}", + ); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FormulaScreen( + formula: sampleFormula, + corpus: widget.corpus, + ), + ), + ); + }, + ), + ], ), body: Column( children: [