【问题标题】:how to change color of dropdown underline如何更改下拉下划线的颜色
【发布时间】:2021-03-10 02:51:07
【问题描述】:

在我的代码中 Container(height: 1, color: UtilColors.grey), 没有给出预期的输出

Container(
              margin: EdgeInsets.only(left: 52, right: 48),
              child: DropdownButton<String>(
                isExpanded: true,
                //Container(height: 1, color: UtilColors.grey),
                value: _selectedUser,
                items: _userTypes.map((String value) {
                  return new DropdownMenuItem<String>(value: value, child: new Text(value));
                }).toList(),
               /* decoration: InputDecoration(contentPadding: EdgeInsets.only(left: 15), suffixIcon: IconButton(onPressed: () {
                 // _userTypes.map((String value){return new DropdownMenuItem<String>(value: value, child: new Text(value));}).toList();
                   }, icon: Icon(null),)),*/
                icon: Icon(Icons.keyboard_arrow_down),
                hint: Text(UtilString.userType),
                onChanged: (value) => setState(() => _selectedUser = value),
              ),
            ),

【问题讨论】:

    标签: flutter colors dropdown underline


    【解决方案1】:

    终于用 DropdownButton 解决了 -

    下划线:容器(高度:2, 颜色:Colors.deepPurpleAccent,),

    这将改变下拉下划线的颜色。

    【讨论】:

      猜你喜欢
      • 2012-09-15
      • 2018-09-11
      • 2015-04-08
      • 2017-07-23
      • 1970-01-01
      • 1970-01-01
      • 2021-04-30
      • 2018-11-10
      相关资源
      最近更新 更多