Added ProfilePicture to ChatPage
parent
c0d0fc3943
commit
79c5b562cb
|
@ -11,12 +11,14 @@ class ChatPage extends StatefulWidget {
|
|||
final String receiverEmail;
|
||||
final String receiverID;
|
||||
final String chatTitle;
|
||||
final String? profileImageUrl;
|
||||
|
||||
const ChatPage({
|
||||
super.key,
|
||||
required this.receiverEmail,
|
||||
required this.receiverID,
|
||||
required this.chatTitle,
|
||||
this.profileImageUrl,
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -90,8 +92,20 @@ class _ChatPageState extends State<ChatPage> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget chatHeader = Text(widget.chatTitle);
|
||||
Widget? userPic;
|
||||
if (widget.profileImageUrl != null && widget.profileImageUrl!.isNotEmpty) {
|
||||
userPic =
|
||||
CircleAvatar(backgroundImage: NetworkImage(widget.profileImageUrl!));
|
||||
}
|
||||
if (userPic != null) {
|
||||
chatHeader = Row(
|
||||
children: [userPic, const SizedBox(width: 7), Text(widget.chatTitle)],
|
||||
);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(widget.chatTitle)),
|
||||
appBar: AppBar(title: chatHeader),
|
||||
body: Column(
|
||||
children: [
|
||||
// display all messages
|
||||
|
|
|
@ -15,7 +15,7 @@ class ConversationsPage extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('My Chat Contacts'),
|
||||
title: const Text('My Chat Connections'),
|
||||
),
|
||||
body: _buildUserMatchesList(),
|
||||
);
|
||||
|
@ -78,6 +78,7 @@ class ConversationsPage extends StatelessWidget {
|
|||
receiverEmail: userData[Constants.dbFieldUsersEmail],
|
||||
receiverID: userData[Constants.dbFieldUsersID],
|
||||
chatTitle: userData[Constants.dbFieldUsersName],
|
||||
profileImageUrl: userData[Constants.dbFieldUsersProfilePic],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -340,6 +340,7 @@ class LikedUsersPageState extends State<LikedUsersPage> {
|
|||
receiverEmail: user[Constants.dbFieldUsersEmail],
|
||||
receiverID: user[Constants.dbFieldUsersID],
|
||||
chatTitle: user[Constants.dbFieldUsersName],
|
||||
profileImageUrl: user[Constants.dbFieldUsersProfilePic],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -261,6 +261,7 @@ class UserMatchingPageState extends State<UserMatchingPage> {
|
|||
receiverEmail: swipedUser.email,
|
||||
receiverID: swipedUser.uid,
|
||||
chatTitle: swipedUser.name,
|
||||
profileImageUrl: swipedUser.profilePictureUrl,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue