Funciona hot-reload, no funciona cambiar las unidades del output

This commit is contained in:
alvaro@a37 2026-01-28 14:06:57 +01:00
parent 8d020f5807
commit 8283941125
3 changed files with 16 additions and 10 deletions

View file

@ -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

View file

@ -53,6 +53,8 @@ exec_in_container(){
mkdir -p $BUILDCACHE
$DOCKER run \
-it \
--init \
--rm \
$GRAPHICOPTIONS \
$SPIOPTIONS \

View file

@ -93,6 +93,7 @@ class _FormulaScreenState extends State<FormulaScreen> {
}
void _evaluateFormula() {
print( "EVALUATE FORMULA");
if (!_formKey.currentState!.validate()) return;
try {
@ -271,10 +272,10 @@ class _FormulaScreenState extends State<FormulaScreen> {
variable: widget.formula.output,
selectedUnit: _selectedOutputUnit,
onUnitChanged: (unit) {
setState(() {
_selectedOutputUnit = unit;
});
_selectedOutputUnit = unit;
_evaluateFormula();
setState(() {
});
},
),
],
@ -301,10 +302,10 @@ class _FormulaScreenState extends State<FormulaScreen> {
.map((v) => DropdownMenuItem<String>(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<FormulaScreen> {
variable: variable,
selectedUnit: _selectedUnits[variable.name],
onUnitChanged: (unit) {
setState(() {
_selectedUnits[variable.name] = unit;
});
_selectedUnits[variable.name] = unit;
_evaluateFormula();
setState(() {
});
},
),
] else ...[