Unverified Commit bbec650b authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

`DropdownButton`: Fix hint alignment when `selectedItemBuilder` is non-null. (#106731)

parent cf342254
......@@ -1397,17 +1397,17 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> with WidgetsBindi
int? hintIndex;
if (widget.hint != null || (!_enabled && widget.disabledHint != null)) {
Widget displayedHint = _enabled ? widget.hint! : widget.disabledHint ?? widget.hint!;
if (widget.selectedItemBuilder == null) {
displayedHint = _DropdownMenuItemContainer(alignment: widget.alignment, child: displayedHint);
}
final Widget displayedHint = _enabled ? widget.hint! : widget.disabledHint ?? widget.hint!;
hintIndex = items.length;
items.add(DefaultTextStyle(
style: _textStyle!.copyWith(color: Theme.of(context).hintColor),
child: IgnorePointer(
ignoringSemantics: false,
child: displayedHint,
child: _DropdownMenuItemContainer(
alignment: widget.alignment,
child: displayedHint,
),
),
));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment