changing layout sizes
This commit is contained in:
parent
5108b405e0
commit
3a5caece03
4 changed files with 9 additions and 9 deletions
|
|
@ -388,10 +388,10 @@ class _FormulaScreenState extends State<FormulaScreen> {
|
||||||
children: [
|
children: [
|
||||||
// Fixed width for field name
|
// Fixed width for field name
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 150,
|
width: 50,
|
||||||
child: Text(
|
child: Text(
|
||||||
variable.name,
|
variable.name,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.fade
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8), // Add some spacing
|
const SizedBox(width: 8), // Add some spacing
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ class _ImportPreviewScreenState extends State<ImportPreviewScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
widget.corpus.loadFormulaElements(selectedElements);
|
widget.corpus.loadFormulaElements(selectedElements, true);
|
||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ class UnitDropdown extends StatelessWidget {
|
||||||
final availableUnits = unitNames.map((name) => corpus.getUnit(name)).toList();
|
final availableUnits = unitNames.map((name) => corpus.getUnit(name)).toList();
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 200, // Constrain dropdown width
|
width: 50, // Constrain dropdown width
|
||||||
child: DropdownButton<String>(
|
child: DropdownButton<String>(
|
||||||
value: selectedUnit ?? variable.unit,
|
value: selectedUnit ?? variable.unit,
|
||||||
selectedItemBuilder: (context) => availableUnits.map((unit) =>
|
selectedItemBuilder: (context) => availableUnits.map((unit) =>
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 200,
|
width: 200,
|
||||||
child: Text(unit.symbol, overflow: TextOverflow.ellipsis),
|
child: Text(unit.symbol, overflow: TextOverflow.ellipsis),
|
||||||
|
|
@ -41,7 +41,7 @@ class UnitDropdown extends StatelessWidget {
|
||||||
value: unit.name,
|
value: unit.name,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 200, // Fixed width for all items
|
width: 200, // Fixed width for all items
|
||||||
child: Text("${unit.symbol} - ${unit.name}",
|
child: Text("${unit.symbol} - ${unit.name}",
|
||||||
style: const TextStyle(fontSize: 14),
|
style: const TextStyle(fontSize: 14),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ class Corpus{
|
||||||
|
|
||||||
/// Loads formula elements, making sure to load units first, then formulas
|
/// Loads formula elements, making sure to load units first, then formulas
|
||||||
/// to avoid dependency issues.
|
/// to avoid dependency issues.
|
||||||
void loadFormulaElements(List<FormulaElement> elements) {
|
void loadFormulaElements(List<FormulaElement> elements, [bool replaceOnDuplicates = false]) {
|
||||||
List<UnitSpec> units = [];
|
List<UnitSpec> units = [];
|
||||||
List<Formula> formulas = [];
|
List<Formula> formulas = [];
|
||||||
|
|
||||||
|
|
@ -239,10 +239,10 @@ class Corpus{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load units first to satisfy dependencies
|
// Load units first to satisfy dependencies
|
||||||
loadUnits(units);
|
loadUnits(units, replaceOnDuplicates);
|
||||||
|
|
||||||
// Then load formulas
|
// Then load formulas
|
||||||
loadFormulas(formulas);
|
loadFormulas(formulas, replaceOnDuplicates: replaceOnDuplicates, checkUnits: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Loads corpus from database elements
|
/// Loads corpus from database elements
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue