你好,这是我的代码:
floatingActionButton: FloatingActionButton(onPressed:(){
Icon(Icons.edit);
} ,),问题是,当我添加任何图标(如icons.edit或icons.alarm等)时,它会显示空循环按钮。

发布于 2020-10-23 15:02:33
floatingActionButton: FloatingActionButton(
onPressed: () {
//do something
},
child: Icon(Icons.edit),
),这是因为你要把图标放在onPressed上。OnPressed是在按下按钮时执行的代码,添加一个子图标小部件。
发布于 2020-10-23 15:02:23
您还没有在FloatingActionButton中添加一个子级。
指定FloatingActionButton的FloatingActionButton属性
floatingActionButton: FloatingActionButton(
child: Icon(Icons.edit, color: Colors.white),
onPressed:(){
// onPressed function
},
),https://stackoverflow.com/questions/64502420
复制相似问题