如何更改PopupMenuButton上的图标颜色,我已将Theme与iconTheme一起使用,但它不会影响CheckedPopupMenuItem或PopupMenuItem上的图标。
Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
elevation: 0.0,
backgroundColor: Colors.transparent,
actions: <Widget>[
Theme(
data: Theme.of(context).copyWith(
cardColor: Colors.indigo,
iconTheme: IconThemeData(color: Colors.white),
),
child: ListTileTheme(
iconColor: Colors.white,
child: PopupMenuButton<String>(
onSelected: _showCheckedMenuSelections,
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
CheckedPopupMenuItem<String>(
value: _checkedValue1,
checked: _showRoles,
child: Text(_checkedValue1, style: Theme.of(context).textTheme.body1),
),
const PopupMenuDivider(),
PopupMenuItem<String>(
value: 'Get Link',
child: ListTile(
leading: Icon(Icons.phonelink),
title: Text('Get link', style: Theme.of(context).textTheme.body1),
),
),
],
),
),
),
],
),
答案 0 :(得分:3)
只需这样做
appBar: AppBar(
iconTheme: IconThemeData(color: Colors.white, size: 10.0),
elevation: 4.0,
backgroundColor: Colors.black,
)
答案 1 :(得分:0)