簡體   English   中英

如何更改下拉下划線的顏色

[英]how to change color of dropdown underline

在我的代碼Container(height: 1, color: UtilColors.grey),沒有給出預期的 output

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),
              ),
            ),

終於得到了 DropdownButton 的解決方案 -

下划線:容器(高度:2,顏色:Colors.deepPurpleAccent,),

這將改變下拉下划線顏色。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM