changing layout sizes
This commit is contained in:
parent
3a5caece03
commit
12d755d810
1 changed files with 23 additions and 24 deletions
|
|
@ -25,31 +25,30 @@ class UnitDropdown extends StatelessWidget {
|
|||
width: 50, // Constrain dropdown width
|
||||
child: DropdownButton<String>(
|
||||
value: selectedUnit ?? variable.unit,
|
||||
selectedItemBuilder: (context) => availableUnits.map((unit) =>
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: Text(unit.symbol, overflow: TextOverflow.ellipsis),
|
||||
)
|
||||
).toList(),
|
||||
icon: const Icon(Icons.arrow_drop_down),
|
||||
elevation: 16,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.primary, fontSize: 14),
|
||||
underline: Container(height: 1, color: Theme.of(context).dividerColor),
|
||||
onChanged: onUnitChanged,
|
||||
items: availableUnits.map<DropdownMenuItem<String>>((UnitSpec unit) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: unit.name,
|
||||
child: SizedBox(
|
||||
width: 200, // Fixed width for all items
|
||||
child: Text("${unit.symbol} - ${unit.name}",
|
||||
style: const TextStyle(fontSize: 14),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
selectedItemBuilder: (context) => availableUnits
|
||||
.map((unit) => SizedBox(width: 50, child: Text(unit.symbol, overflow: TextOverflow.ellipsis)))
|
||||
.toList(),
|
||||
icon: const Icon(Icons.arrow_drop_down),
|
||||
elevation: 16,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.primary, fontSize: 14),
|
||||
underline: Container(height: 1, color: Theme.of(context).dividerColor),
|
||||
onChanged: onUnitChanged,
|
||||
items: availableUnits.map<DropdownMenuItem<String>>((UnitSpec unit) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: unit.name,
|
||||
child: SizedBox(
|
||||
width: 300, // Fixed width for all items
|
||||
child: Text(
|
||||
"${unit.symbol} - ${unit.name}",
|
||||
style: const TextStyle(fontSize: 14),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
menuMaxHeight: 400,
|
||||
isExpanded: true,
|
||||
);
|
||||
}).toList(),
|
||||
menuWidth: 300,
|
||||
menuMaxHeight: 400,
|
||||
isExpanded: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue