通过阅读文档,我确信这是已经声明好的,但添加图标仍然是灰色的。
class _TaskState extends State<Task> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.red,
title: Text('Tasks'),
centerTitle: true,
actions: <Widget>[
IconButton(
icon: Icon(Icons.add),
color: Colors.white,
iconSize: 32.0,
),
],
),
drawer: TheDrawer()
);
}
}