Mub*_*ade 7 dart flutter flutter-layout
我需要FloatingActionButton在我的应用程序中长按我的期间执行辅助操作。
floatingActionButton: FloatingActionButton(
onPressed: someFunction,
child: Icon(Icons.add),
onLongPressed: //Something like this or any other solution
),
Run Code Online (Sandbox Code Playgroud)
我建议使用,InkWell以便您也可以产生涟漪效应。
这是您如何使用它。
floatingActionButton: InkWell(
splashColor: Colors.blue,
onLongPress: () {
// handle your long press functionality here
},
child: FloatingActionButton(
child: Icon(Icons.add),
onPressed: someFunction,
),
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2743 次 |
| 最近记录: |