小编ada*_*ori的帖子

Flutter - 如何为 IconButton 提供颜色?

通过阅读文档,我确信这是明确声明的,但添加图标仍然是灰色的。

 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()
             );
           }
         }
Run Code Online (Sandbox Code Playgroud)

flutter iconbutton

3
推荐指数
1
解决办法
3656
查看次数

标签 统计

flutter ×1

iconbutton ×1