feat: show unit symbol and name in dropdown options
Co-authored-by: aider (openrouter/deepseek/deepseek-r1:free) <aider@aider.chat>
This commit is contained in:
parent
861891c6a1
commit
3c22dc06f5
1 changed files with 2 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ class UnitDropdown extends StatelessWidget {
|
|||
|
||||
return DropdownButton<String>(
|
||||
value: selectedUnit ?? variable.unit,
|
||||
selectedItemBuilder: (context) => availableUnits.map((unit) => Text(unit.symbol)).toList(),
|
||||
icon: const Icon(Icons.arrow_drop_down),
|
||||
elevation: 16,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.primary, fontSize: 14),
|
||||
|
|
@ -31,7 +32,7 @@ class UnitDropdown extends StatelessWidget {
|
|||
items: availableUnits.map<DropdownMenuItem<String>>((UnitSpec unit) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: unit.name,
|
||||
child: Text(unit.symbol, style: const TextStyle(fontSize: 14)),
|
||||
child: Text("${unit.symbol} - ${unit.name}", style: const TextStyle(fontSize: 14)),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue