From 8283941125d0c780c3e0ebdc9ca10ad416918109 Mon Sep 17 00:00:00 2001 From: "alvaro@a37" Date: Wed, 28 Jan 2026 14:06:57 +0100 Subject: [PATCH] Funciona hot-reload, no funciona cambiar las unidades del output --- Makefile | 5 ++++- docker-exec.sh | 2 ++ lib/ai/formula_screen.dart | 19 ++++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 84b2d0b..287ab74 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,10 @@ build-web-debug-container: pub-get-container ./docker-exec.sh exec flutter build web --debug run-linux-debug-container: build-linux-debug-container - ./docker-exec.sh exec /app/build/linux/x64/debug/bundle/d4rt_formulas + ./docker-exec.sh exec flutter run -d linux + +run-linux-debug: build-linux-debug-container + ./build/linux/x64/debug/bundle/d4rt_formulas run-web-debug-container: build-web-debug-container cd build/web && python3 -m http.server 8080 diff --git a/docker-exec.sh b/docker-exec.sh index e8147c0..664b007 100755 --- a/docker-exec.sh +++ b/docker-exec.sh @@ -53,6 +53,8 @@ exec_in_container(){ mkdir -p $BUILDCACHE $DOCKER run \ + -it \ + --init \ --rm \ $GRAPHICOPTIONS \ $SPIOPTIONS \ diff --git a/lib/ai/formula_screen.dart b/lib/ai/formula_screen.dart index 996a63b..5324954 100644 --- a/lib/ai/formula_screen.dart +++ b/lib/ai/formula_screen.dart @@ -93,6 +93,7 @@ class _FormulaScreenState extends State { } void _evaluateFormula() { + print( "EVALUATE FORMULA"); if (!_formKey.currentState!.validate()) return; try { @@ -271,10 +272,10 @@ class _FormulaScreenState extends State { variable: widget.formula.output, selectedUnit: _selectedOutputUnit, onUnitChanged: (unit) { - setState(() { - _selectedOutputUnit = unit; - }); + _selectedOutputUnit = unit; _evaluateFormula(); + setState(() { + }); }, ), ], @@ -301,10 +302,10 @@ class _FormulaScreenState extends State { .map((v) => DropdownMenuItem(value: v, child: Text(v))) .toList(), onChanged: (v) { - setState(() { - _selectedValues[variable.name] = v; - }); + _selectedValues[variable.name] = v; _evaluateFormula(); + setState(() { + }); }, decoration: const InputDecoration( border: UnderlineInputBorder(), @@ -322,10 +323,10 @@ class _FormulaScreenState extends State { variable: variable, selectedUnit: _selectedUnits[variable.name], onUnitChanged: (unit) { - setState(() { - _selectedUnits[variable.name] = unit; - }); + _selectedUnits[variable.name] = unit; _evaluateFormula(); + setState(() { + }); }, ), ] else ...[