0

我需要将颤动下拉按钮从其父级扩展得更多,以便所有下拉菜单项都适合它。

现在我正在使用 Row > Expanded > DropdownButton + isExpanded 这是结果 在此处输入图像描述

这是脚手架结构:

Scaffold( ... body: Container(child: Column(children: [ .., 
Expanded(child: SingleChildScrollView(
 child: Container(
   child: Column(
    children: [ ..,
      IntrinsicHeight( 
      child: Expanded( flex: 4, 
          child: Row([ .., 
                DropdownButton(
                    isExpanded: true,
                    elevation: 24
                ),..] ... ]
4

1 回答 1

0

看看这个:https ://github.com/flutter/flutter/pull/14849

您现在可以将其包装在 ButtonTheme 中并将对齐的Dropdown 设置为 true。

 Row(children: [ButtonTheme(alignedDropdown: true   child:DropdownButton(...))])
于 2021-04-01T17:10:19.690 回答