📜  如何在颤动中更改颜色图标 DropdownMenuItem - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:16.785000             🧑  作者: Mango

代码示例1
DropdownButton(
  value: null,
  iconSize: 0,
  hint: Row(
    children: [
      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 value) {
    return DropdownMenuItem(
      value: value['type'],
      child: Text(
        value['name'],
        style: TextStyle(
          color: Colors.grey[800],
          fontWeight: FontWeight.w700,
        ),
      ),
    );
  }).toList(),
  onChanged: (type) => _onDateRangeTypeChanged(type),
)