如何运行滑动动作内部的功能
我的代码中有一个滑道,我想运行每张卡中的每个卡中的函数,然后运行时,它会在循环中运行,然后像未按下(null)一样按住它的压力(null)如何使用Onpressed -pressed?
// A SlidableAction can have an icon and/or a label.
SlidableAction(
onPressed: deletTransact(),
backgroundColor: Color(0xFFFE4A49),
foregroundColor: Colors.white,
icon: Icons.delete,
label: 'Delete',
),
SlidableAction(
// An action can be bigger than the others.
flex: 2,
onPressed: editTransact(),
backgroundColor: Color(0xFF2196f3),
foregroundColor: Colors.white,
icon: Icons.edit,
label: 'Edit',
),
deletTransact() {
print("delete");
}
editTransact() { print("edit");
}
}
I have a slidable in my code and i want to run the functions inside each card on pressed when run it it runs with the loop and after that the onpressed like its not pressed(null) how can the functions runs with the onpressed??
// A SlidableAction can have an icon and/or a label.
SlidableAction(
onPressed: deletTransact(),
backgroundColor: Color(0xFFFE4A49),
foregroundColor: Colors.white,
icon: Icons.delete,
label: 'Delete',
),
SlidableAction(
// An action can be bigger than the others.
flex: 2,
onPressed: editTransact(),
backgroundColor: Color(0xFF2196f3),
foregroundColor: Colors.white,
icon: Icons.edit,
label: 'Edit',
),
deletTransact() {
print("delete");
}
editTransact() { print("edit");
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)