Skip to content

Commit

Permalink
feat: support send voice message
Browse files Browse the repository at this point in the history
  • Loading branch information
path-yu committed Jan 2, 2023
1 parent 726c577 commit 239a327
Show file tree
Hide file tree
Showing 6 changed files with 375 additions and 79 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cSpell.words": ["sublist"]
}
9 changes: 6 additions & 3 deletions lib/common/firebase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,16 @@ Future<Map<String, dynamic>> handleChatData(
'isMyRequest': isMyRequest,
'userName': isMyRequest ? data['userName'] : data['targetUserName'],
'avatar': isMyRequest ? data['userPhotoURL'] : data['targetUserPhotoURL'],
'showCreateTime': formatMessageDate(message['createTime'])
'showCreateTime': formatMessageDate(message['createTime']),
};
}).toList();
if (!data['messageList'].isEmpty) {
var lastMessage = data['messageList'][messages.length - 1];
data['lastMessage'] =
lastMessage['type'] == 'pic' ? '[picture]' : lastMessage['content'];
data['lastMessage'] = lastMessage['type'] == 'pic'
? '[picture]'
: lastMessage['type'] == 'voice'
? '[voice]'
: lastMessage['content'];
data['showAvatar'] = lastMessage['avatar'];
data['showUserName'] = lastMessage['userName'];
} else {
Expand Down
Loading

0 comments on commit 239a327

Please sign in to comment.