Flutter 如何从此dart流返回正确的类型 Stream getChats(字符串聊天室ID){ 返回getChatroomStream(chatroomid).map((事件){ var快照=_db .collection('k-chats/$chatroomid

Flutter 如何从此dart流返回正确的类型 Stream getChats(字符串聊天室ID){ 返回getChatroomStream(chatroomid).map((事件){ var快照=_db .collection('k-chats/$chatroomid,flutter,dart,Flutter,Dart,如何从此dart流返回正确的类型 Stream getChats(字符串聊天室ID){ 返回getChatroomStream(chatroomid).map((事件){ var快照=_db .collection('k-chats/$chatroomid/chats') .where('开始时间',' Stream<List<Chat>> getChats(String chatroomid) { return getChatroomStream(chatroo

如何从此dart流返回正确的类型
Stream getChats(字符串聊天室ID){
返回getChatroomStream(chatroomid).map((事件){
var快照=_db
.collection('k-chats/$chatroomid/chats')
.where('开始时间','
Stream<List<Chat>> getChats(String chatroomid) {
    return getChatroomStream(chatroomid).map((event) {
      var snapshots = _db
          .collection('k-chats/$chatroomid/chats')
          .where('start_time', '<=', event.date)
          .orderBy('created_at', descending: true)
          .snapshots();

      return snapshots.map(
          (list) => list.docs.map((doc) => Chat.fromMap(doc.data())).toList());
    });