changing layout sizes
This commit is contained in:
parent
3a5caece03
commit
12d755d810
1 changed files with 23 additions and 24 deletions
|
|
@ -25,12 +25,9 @@ class UnitDropdown extends StatelessWidget {
|
||||||
width: 50, // 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
|
||||||
SizedBox(
|
.map((unit) => SizedBox(width: 50, child: Text(unit.symbol, overflow: TextOverflow.ellipsis)))
|
||||||
width: 200,
|
.toList(),
|
||||||
child: Text(unit.symbol, overflow: TextOverflow.ellipsis),
|
|
||||||
)
|
|
||||||
).toList(),
|
|
||||||
icon: const Icon(Icons.arrow_drop_down),
|
icon: const Icon(Icons.arrow_drop_down),
|
||||||
elevation: 16,
|
elevation: 16,
|
||||||
style: TextStyle(color: Theme.of(context).colorScheme.primary, fontSize: 14),
|
style: TextStyle(color: Theme.of(context).colorScheme.primary, fontSize: 14),
|
||||||
|
|
@ -40,14 +37,16 @@ class UnitDropdown extends StatelessWidget {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: unit.name,
|
value: unit.name,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 200, // Fixed width for all items
|
width: 300, // 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,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
menuWidth: 300,
|
||||||
menuMaxHeight: 400,
|
menuMaxHeight: 400,
|
||||||
isExpanded: true,
|
isExpanded: true,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue