Flutter 如何将isselected应用于颤振颜色的文档快照:(snapshot.data.documents[index].isselected)?颜色。红色[100]:颜色。白色,

Flutter 如何将isselected应用于颤振颜色的文档快照:(snapshot.data.documents[index].isselected)?颜色。红色[100]:颜色。白色,,flutter,dart,google-cloud-firestore,Flutter,Dart,Google Cloud Firestore,如果我将isselected应用于snapshot.data.documents[index],我会收到一个错误,说明类“DocumentSnapshot”没有实例获取程序“isselected”。 接收方:“DocumentSnapshot”的实例 已尝试呼叫:isSelected 我怎样才能解决这个问题 return GestureDetector( child: Container( margin: Edg

如果我将isselected应用于snapshot.data.documents[index],我会收到一个错误,说明类“DocumentSnapshot”没有实例获取程序“isselected”。 接收方:“DocumentSnapshot”的实例 已尝试呼叫:isSelected

我怎样才能解决这个问题


 return GestureDetector(
                  child: Container(
                      margin: EdgeInsets.symmetric(vertical: 4),
                      color: (snapshot.data.documents[index].isSelected)
                          ? Colors.red[100]
                          : Colors.white,
                      

错误表明isSelected不是DocumentSnapshot的属性。你能提供你的完整代码并解释你想要实现什么吗?