我正在尝试编写与Cloud Firestore链接的Todo App。我希望当我点击作为手势检测器的图块时,该任务在Firestore上被删除,但无法正常工作。这是我使用的功能代码以及所有必要的代码。
final _firestore = FirebaseFirestore.instance;
///
void deleteTask(){
_firestore.collection("todos").doc().delete();
}
///
child: GestureDetector(
onLongPress: (){
deleteTask();
},
child: Container(
如果您有任何想法,请告诉我。谢谢!
请参考以下解决方案:stackoverflow.com/a/65960948/14950155
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句