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] 删除。
我来说两句