Flutter中的LongAction侦听器上的FloatingActionButton

穆巴拉克·扎德

FloatingActionButton在我的应用中长按时,我需要执行第二项操作

floatingActionButton: FloatingActionButton(
  onPressed: someFunction,
  child: Icon(Icons.add),
  onLongPressed: //Something like this or any other solution
),
公路警察

我建议使用,InkWell以便您也可以产生涟漪效应。

这是您可以使用它的方式。

floatingActionButton: InkWell(
  splashColor: Colors.blue,
  onLongPress: () {
    // handle your long press functionality here
  },
  child: FloatingActionButton(
    child: Icon(Icons.add),
    onPressed: someFunction,
  ),
)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章