简体   繁体   中英

how to change color of dropdown underline

in my code Container(height: 1, color: UtilColors.grey), not giving expeceted 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),
              ),
            ),

finally got the solution with DropdownButton -

underline: Container( height: 2, color: Colors.deepPurpleAccent,),

this will change dropdown underline color.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM