Adjust style of app dropdown button

This commit is contained in:
Hillel Coren 2023-11-08 16:52:27 +02:00
parent 8dfe0e38d1
commit 5bb5d4ce57
1 changed files with 18 additions and 17 deletions

View File

@ -34,25 +34,26 @@ class AppDropdownButton<T> extends StatelessWidget {
}
final bool isEmpty = checkedValue == null || checkedValue == '';
Widget dropDownButton = DropdownButtonHideUnderline(
child: DropdownButton<T>(
value: checkedValue,
isExpanded: true,
isDense: labelText != null,
onChanged: enabled ? onChanged : null,
selectedItemBuilder: selectedItemBuilder,
items: [
if (showBlank || isEmpty)
DropdownMenuItem<T>(
value: blankValue,
child: blankLabel == null ? SizedBox() : Text(blankLabel!),
),
...items
],
),
Widget dropDownButton = DropdownButtonFormField<T>(
decoration: labelText != null
? InputDecoration(label: Text(labelText!))
: InputDecoration.collapsed(hintText: ''),
value: checkedValue == blankValue ? null : checkedValue,
isExpanded: true,
isDense: labelText != null,
onChanged: enabled ? onChanged : null,
selectedItemBuilder: selectedItemBuilder,
items: [
if (showBlank || isEmpty)
DropdownMenuItem<T>(
value: blankValue,
child: blankLabel == null ? SizedBox() : Text(blankLabel!),
),
...items
],
);
if (labelText != null) {
if (false && labelText != null) {
dropDownButton = InputDecorator(
decoration: InputDecoration(
labelText: labelText!.isEmpty ? null : labelText,