The formula is updated when edited and saved
This commit is contained in:
parent
0d20542825
commit
546966ccfa
2 changed files with 8 additions and 2 deletions
|
|
@ -81,6 +81,11 @@ class _FormulaListState extends State<FormulaList> {
|
||||||
builder: (context) => FormulaEditor(
|
builder: (context) => FormulaEditor(
|
||||||
formula: formula,
|
formula: formula,
|
||||||
corpus: widget.corpus,
|
corpus: widget.corpus,
|
||||||
|
onSave: (updatedFormula){
|
||||||
|
setState((){
|
||||||
|
// THIS UPDATES THE FORMULA LIST
|
||||||
|
});
|
||||||
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ import 'unit_dropdown.dart';
|
||||||
import 'formula_editor.dart';
|
import 'formula_editor.dart';
|
||||||
|
|
||||||
class FormulaScreen extends StatefulWidget {
|
class FormulaScreen extends StatefulWidget {
|
||||||
final Formula formula;
|
Formula formula;
|
||||||
final Corpus corpus;
|
final Corpus corpus;
|
||||||
|
|
||||||
const FormulaScreen({super.key, required this.formula, required this.corpus});
|
FormulaScreen({super.key, required this.formula, required this.corpus});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FormulaScreen> createState() => _FormulaScreenState();
|
State<FormulaScreen> createState() => _FormulaScreenState();
|
||||||
|
|
@ -218,6 +218,7 @@ class _FormulaScreenState extends State<FormulaScreen> {
|
||||||
// Refresh the screen after saving
|
// Refresh the screen after saving
|
||||||
setState(() {
|
setState(() {
|
||||||
// The corpus has been updated, refresh the displayed formula
|
// The corpus has been updated, refresh the displayed formula
|
||||||
|
widget.formula = updatedFormula;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue