Answers for "how to change color of dropdownmenuitem flutter"

1

flutter dropdown menu background color

// Wrap it in a Theme() Widget like this
Theme(
	data: Theme.of(context).copyWith(canvasColor: Colors.green),
    child: DropdownButton(
                  value: yourValue,
                  icon: Icon(Icons.keyboard_arrow_down, color: Colors.white),
                  onChanged: (value) {
                    
                  },
                  items: yourItems,
                  style: TextStyle(color: Colors.white),
         ),
),
Posted by: Guest on July-08-2021
0

how to change color icon DropdownMenuItem in flutter

DropdownButton<int>(
  value: null,
  iconSize: 0,
  hint: Row(
    children: <Widget>[
      Text(_selected,
        style: TextStyle(
          color: Colors.white,
          fontWeight: FontWeight.w700,
        ),
      ),
      Padding(
        padding: EdgeInsets.only(left: 5),
        child: Icon(
          FontAwesomeIcons.caretDown,
          color: Colors.white,
          size: 20,
        ),
      ),
    ],
  ),
  items: dateRanges.map((Map<String, dynamic> value) {
    return DropdownMenuItem<int>(
      value: value['type'],
      child: Text(
        value['name'],
        style: TextStyle(
          color: Colors.grey[800],
          fontWeight: FontWeight.w700,
        ),
      ),
    );
  }).toList(),
  onChanged: (type) => _onDateRangeTypeChanged(type),
)
Posted by: Guest on March-18-2021

Code answers related to "how to change color of dropdownmenuitem flutter"

Browse Popular Code Answers by Language